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
-
IDENT
- Identifier for this attribute, to be used with the
get, set, delete methods of Certificate, x509 type.
-
NAME
- Sub attributes name for this CertAttrSet.
-
NOT_AFTER
-
-
NOT_BEFORE
-
-
PrivateKeyUsageExtension(Boolean, Object)
- Create the extension from the passed DER encoded value.
-
PrivateKeyUsageExtension(Date, Date)
- The default constructor for PrivateKeyUsageExtension.
-
decode(InputStream)
- Decode the extension from the InputStream.
-
delete(String)
- Delete the attribute value.
-
encode(OutputStream)
- Write the extension to the OutputStream.
-
get(String)
- Get the attribute value.
-
getElements()
- Return an enumeration of names of attributes existing within this
attribute.
-
getName()
- Return the name of this attribute.
-
set(String, Object)
- Set the attribute value.
-
toString()
- Return the printable string.
-
valid()
- Verify that that the current time is within the validity period.
-
valid(Date)
- Verify that that the passed time is within the validity period.
IDENT
public static final String IDENT
- Identifier for this attribute, to be used with the
get, set, delete methods of Certificate, x509 type.
NAME
public static final String NAME
- Sub attributes name for this CertAttrSet.
NOT_BEFORE
public static final String NOT_BEFORE
NOT_AFTER
public static final String NOT_AFTER
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.
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.
toString
public String toString()
- Return the printable string.
- Overrides:
- toString in class Extension
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.
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.
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.
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.
set
public void set(String name,
Object obj) throws CertificateException
- Set the attribute value.
- Throws: CertificateException
- on attribute handling errors.
get
public Object get(String name) throws CertificateException
- Get the attribute value.
- Throws: CertificateException
- on attribute handling errors.
delete
public void delete(String name) throws CertificateException
- Delete the attribute value.
- Throws: CertificateException
- on attribute handling errors.
getElements
public Enumeration getElements()
- Return an enumeration of names of attributes existing within this
attribute.
getName
public String getName()
- Return the name of this attribute.
All Packages Class Hierarchy This Package Previous Next Index