public class InvalidityDate extends V3Extension
InvalidityDate
extension.
The InvalidityDate
extension is a non critical
standard X509v2 CRL entry extension.
Each extension is associated with a specific certificateExtension
object identifier, derived from:
certificateExtension OBJECT IDENTIFIER ::= {joint-iso-ccitt(2) ds(5) 29} id-ce OBJECT IDENTIFIER ::= certificateExtension
The object identifier for the CRLNumber
extension
is defined as:
id-ce-cRLReason OBJECT IDENTIFIER ::= { id-ce 24 }
which corresponds to the OID string "2.5.29.24".
The X.509 Certificate and CRL profile presented in specifies the InvalityDate
extension for providing the date on which it is known or suspected
that the private key was compromised or that the certificate otherwise
became invalid. This date may be earlier than the revocation date in
the CRL entry, which is the date at which the CA processed the revocation.
When a revocation is first posted by a CA in a CRL, the invalidity date may
precede the date of issue of earlier CRLs, but the revocation date
SHOULD NOT precede the date of issue of earlier CRLs. Whenever this
information is available, CAs are strongly encouraged to share it
with CRL users.
ASN.1 definition:
Since in the IAIK-JCE environment revoked certificates are implementations of
the
invalidityDate ::= GeneralizedTime
iaik.x509.RevokedCertificate
class, a InvalidityData
CRL entry extension may be added to a
revoked certificate by using the addExtension
method of the iaik.x509.RevokedCertificate
class.
Any revoked certificate itself is added to a certificate revocation list by
using a proper addCertificate
method of the iaik.x509.X509CRL
class, e.g.:
//Create a revoked certificate from a X509Certificate and set the revocation date
//to the current date; the X509Certificate is read in from a file:
GregorianCalendar revocationDate = (GregorianCalendar)Calendar.getInstance();
InputStream fis = new FileInputStream("cert.der");
X509Certificate cert = new X509Certificate(fis);
fis.close();
RevokedCertificate rev_cert = new RevokedCertificate(cert, revocationDate.getTime());
//add the InvalidateDate CRL entry extension to the revoked certificate:
Date date = ...;
InvalidityDate invalidityDate = new InvalidityDate(date);
rev_cert.addExtension(invalidityData);
//add the revoked certificate to the crl
X509CRL crl = new X509CRL();
...
crl.addCertificate(rev_cert);
X509CRL
,
X509Certificate
,
RevokedCertificate
Modifier and Type | Field and Description |
---|---|
static ObjectID |
oid
The object identifier of this InvalidityDate extension.
|
critical
Constructor and Description |
---|
InvalidityDate()
Default constructor.
|
InvalidityDate(java.util.Date invalidityDate)
Creates a new
InvalidityDate from the given date. |
Modifier and Type | Method and Description |
---|---|
java.util.Date |
getInvalidityDate()
Returns the invalidity date.
|
ObjectID |
getObjectID()
Returns the object ID of this
InvalidityDate extension |
int |
hashCode()
Returns a hashcode for this identity.
|
void |
init(ASN1Object obj)
Inits this
InvalidityDate implementation with an ASN1object
representing the value of this extension. |
void |
setInvalidityDate(java.util.Date invalidityDate)
Sets the invality date of this
InvalidityDate object. |
ASN1Object |
toASN1Object()
Returns an ASN1Object representing the value of this
InvalidityDate
extension object. |
java.lang.String |
toString()
Returns a string that represents the contents of the
InvalidityDate
extension. |
getName, isCritical, setCritical
public static final ObjectID oid
public InvalidityDate()
Creates an empty InvalidityDate
object.
Use setInvalidityDate
for specifying the
invalidity date, e.g.:
InvalidityDate invalidityDate = new InvalidityDate(); Date date = ...; invalidityDate.setInvalidityDate(date);
public InvalidityDate(java.util.Date invalidityDate)
InvalidityDate
from the given date.
For instance:
Date date = ...; InvalidityDate invalidityDate = new InvalidityDate(date);
invalidityDate
- the invality date to be setpublic ObjectID getObjectID()
InvalidityDate
extensiongetObjectID
in class V3Extension
public void init(ASN1Object obj) throws X509ExtensionException
InvalidityDate
implementation with an ASN1object
representing the value of this extension.
The given ASN1Object represents a GeneraizedTime giving the invalidity date.
The given ASN1Object is the one created by toASN1Object()
.
This method is used by the X509Extensions
class when parsing the ASN.1 representation
of a CRL for properly initializing an included
InvalidityDate extension. This method initializes the
extension only with its value, but not with its critical
specification. For that reason, this method shall not be
explicitly called by an application.
init
in class V3Extension
obj
- the InvalidityDate as ASN1ObjectX509ExtensionException
- an error occurs when parsing the
supplied ASN.1 objectpublic ASN1Object toASN1Object()
InvalidityDate
extension object.
The returned ASN1Object is an ASN.1 GenaralizedTime representing the invality date:
InvalidityDate ::= GenaralizedTime
toASN1Object
in class V3Extension
InvalidityDate
as ASN1Objectpublic void setInvalidityDate(java.util.Date invalidityDate)
InvalidityDate
object.
For instance:
InvalidityDate invalidityDate = new InvalidityDate(); Date date = ...; invalidityDate.setInvalidityDate(date);
invalidityDate
- the invality date to be setpublic java.util.Date getInvalidityDate()
public int hashCode()
hashCode
in class V3Extension
public java.lang.String toString()
InvalidityDate
extension.toString
in class java.lang.Object