All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class netscape.security.x509.CertificateValidity

netscape.security.x509.CertificateValidity

public class CertificateValidity
implements CertAttrSet
This class defines the interval for which the certificate is valid.

See Also:
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 CertificateValidity()
Default constructor for the class.
 o CertificateValidity(Date, Date)
The default constructor for this class for the specified interval.
 o CertificateValidity(DerInputStream)
Create the object, decoding the values from the passed DER stream.

Method Index

 o decode(InputStream)
Decode the CertificateValidity period from the InputStream.
 o delete(String)
Delete the attribute value.
 o encode(OutputStream)
Encode the CertificateValidity period in DER form to the stream.
 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 validity period as user readable string.
 o valid()
Verify that the current time is within the validity period.
 o valid(Date)
Verify 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 CertificateValidity
 public CertificateValidity()
Default constructor for the class.

 o CertificateValidity
 public CertificateValidity(Date notBefore,
                            Date notAfter)
The default constructor for this class for the specified interval.

Parameters:
notBefore - the date and time before which the certificate is not valid.
notAfter - the date and time after which the certificate is not valid.
 o CertificateValidity
 public CertificateValidity(DerInputStream in) throws IOException
Create the object, decoding the values from the passed DER stream.

Parameters:
in - the DerInputStream to read the CertificateValidity from.
Throws: IOException
on decoding errors.

Methods

 o toString
 public String toString()
Return the validity period as user readable string.

 o decode
 public void decode(InputStream in) throws IOException
Decode the CertificateValidity period from the InputStream.

Parameters:
in - the InputStream to unmarshal the contents from.
Throws: IOException
on errors.
 o encode
 public void encode(OutputStream out) throws IOException
Encode the CertificateValidity period in DER form to the stream.

Parameters:
out - the OutputStream to marshal the contents to.
Throws: IOException
on errors.
 o set
 public void set(String name,
                 Object obj) throws IOException
Set the attribute value.

 o get
 public Object get(String name) throws IOException
Get the attribute value.

 o delete
 public void delete(String name) throws IOException
Delete the attribute value.

 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.

 o valid
 public void valid() throws CertificateNotYetValidException, CertificateExpiredException
Verify 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 the passed time is within the validity period.

Parameters:
now - the Date against which to compare 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.

All Packages  Class Hierarchy  This Package  Previous  Next  Index