All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class netscape.security.x509.PrivateKeyUsageExtension

netscape.security.x509.Extension
   |
   +----netscape.security.x509.PrivateKeyUsageExtension

public class PrivateKeyUsageExtension
extends Extension
implements CertAttrSet
This class defines the Private Key Usage Extension.

The Private Key Usage Period extension allows the certificate issuer to specify a different validity period for the private key than the certificate. This extension is intended for use with digital signature keys. This extension consists of two optional components notBefore and notAfter. The private key associated with the certificate should not be used to sign objects before or after the times specified by the two components, respectively.

 PrivateKeyUsagePeriod ::= SEQUENCE {
     notBefore  [0]  GeneralizedTime OPTIONAL,
     notAfter   [1]  GeneralizedTime OPTIONAL }
 

See Also:
Extension, CertAttrSet

Variable Index

 o IDENT
Identifier for this attribute, to be used with the get, set, delete methods of Certificate, x509 type.
 o NAME
Sub attributes name for this CertAttrSet.
 o NOT_AFTER
 o NOT_BEFORE

Constructor Index

 o PrivateKeyUsageExtension(Boolean, Object)
Create the extension from the passed DER encoded value.
 o PrivateKeyUsageExtension(Date, Date)
The default constructor for PrivateKeyUsageExtension.

Method Index

 o decode(InputStream)
Decode the extension from the InputStream.
 o delete(String)
Delete the attribute value.
 o encode(OutputStream)
Write the extension to the OutputStream.
 o get(String)
Get the attribute value.
 o getElements()
Return an enumeration of names of attributes existing within this attribute.
 o getName()
Return the name of this attribute.
 o set(String, Object)
Set the attribute value.
 o toString()
Return the printable string.
 o valid()
Verify that that the current time is within the validity period.
 o valid(Date)
Verify that that the passed time is within the validity period.

Variables

 o IDENT
 public static final String IDENT
Identifier for this attribute, to be used with the get, set, delete methods of Certificate, x509 type.

 o NAME
 public static final String NAME
Sub attributes name for this CertAttrSet.

 o NOT_BEFORE
 public static final String NOT_BEFORE
 o NOT_AFTER
 public static final String NOT_AFTER

Constructors

 o PrivateKeyUsageExtension
 public PrivateKeyUsageExtension(Date notBefore,
                                 Date notAfter) throws IOException
The default constructor for PrivateKeyUsageExtension.

Parameters:
notBefore - the date/time before which the private key should not be used.
notAfter - the date/time after which the private key should not be used.
 o PrivateKeyUsageExtension
 public PrivateKeyUsageExtension(Boolean critical,
                                 Object value) throws CertificateException, IOException
Create the extension from the passed DER encoded value.

Parameters:
critical - true if the extension is to be treated as critical.
value - Array of DER encoded bytes of the actual value.
Throws: CertificateException
on certificate parsing errors.
Throws: IOException
on error.

Methods

 o toString
 public String toString()
Return the printable string.

Overrides:
toString in class Extension
 o valid
 public void valid() throws CertificateNotYetValidException, CertificateExpiredException
Verify that that the current time is within the validity period.

Throws: CertificateExpiredException
if the certificate has expired.
Throws: CertificateNotYetValidException
if the certificate is not yet valid.
 o valid
 public void valid(Date now) throws CertificateNotYetValidException, CertificateExpiredException
Verify that that the passed time is within the validity period.

Throws: CertificateExpiredException
if the certificate has expired with respect to the Date supplied.
Throws: CertificateNotYetValidException
if the certificate is not yet valid with respect to the Date supplied.
 o encode
 public void encode(OutputStream out) throws IOException
Write the extension to the OutputStream.

Parameters:
out - the OutputStream to write the extension to.
Throws: IOException
on encoding errors.
 o decode
 public void decode(InputStream in) throws CertificateException
Decode the extension from the InputStream.

Parameters:
in - the InputStream to unmarshal the contents from.
Throws: CertificateException
on decoding errors.
 o set
 public void set(String name,
                 Object obj) throws CertificateException
Set the attribute value.

Throws: CertificateException
on attribute handling errors.
 o get
 public Object get(String name) throws CertificateException
Get the attribute value.

Throws: CertificateException
on attribute handling errors.
 o delete
 public void delete(String name) throws CertificateException
Delete the attribute value.

Throws: CertificateException
on attribute handling errors.
 o getElements
 public Enumeration getElements()
Return an enumeration of names of attributes existing within this attribute.

 o getName
 public String getName()
Return the name of this attribute.


All Packages  Class Hierarchy  This Package  Previous  Next  Index