public class CertificateIssuer extends V3Extension
CertificateIssuer
extension.
The CertificateIssuer
extension is a 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 29 }
which corresponds to the OID string "2.5.29.29".
The X.509 Certificate and CRL profile presented in RFC 3280 specifies the CertifcateIssuer extension for identifying the certificate issuer associated with an entry in an indirect CRL, i.e. a CRL that has the indirectCRL indicator set in its issuing distribution point extension. If this extension is not present on the first entry in an indirect CRL, the certificate issuer defaults to the CRL issuer. On subsequent entries in an indirect CRL, if this extension is not present, the certificate issuer for the entry is the same as that for the preceding entry.
ASN.1 definition:
CertificateIssuer ::= GeneralNames
Since in the IAIK-JCE environment revoked certificates are implementations of
the 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 the certificate issuer: GeneralNames issuer = ...; CertificateIssuer certificateIssuer = new CertificateIssuer(issuer); rev_cert.addExtension(certificateIssuer); //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 CertificateIssuer extension.
|
critical
Constructor and Description |
---|
CertificateIssuer()
Default constructor.
|
CertificateIssuer(GeneralNames issuer)
Creates a new
CertificateIssuer from the given issuer name. |
CertificateIssuer(Name issuerDN)
Creates a new
CertificateIssuer from the given issuer dn. |
Modifier and Type | Method and Description |
---|---|
GeneralNames |
getIssuer()
Returns the certificate issuer.
|
Name |
getIssuerDN()
Gets the issuer dn of this
CertificateIssuer object. |
ObjectID |
getObjectID()
Returns the object ID of this
CertificateIssuer extension |
int |
hashCode()
Returns a hashcode for this identity.
|
void |
init(ASN1Object obj)
Inits this
CertificateIssuer implementation with an ASN1object
representing the value of this extension. |
void |
setIssuer(GeneralNames issuer)
Sets the issuer of this
CertificateIssuer object. |
void |
setIssuerDN(Name issuerDN)
Sets the issuer dn of this
CertificateIssuer object. |
ASN1Object |
toASN1Object()
Returns an ASN1Object representing the value of this
CertificateIssuer
extension object. |
java.lang.String |
toString()
Returns a string that represents the contents of the
CertificateIssuer
extension. |
getName, isCritical, setCritical
public static final ObjectID oid
public CertificateIssuer()
Creates an empty CertificateIssuer
object.
Use setIssuer
for specifying the
certificate issuer as {iaik.asn1.structures.GeneralNames
iaik.asn1.structures.GeneralNames} object, e.g.:
GeneralNames issuer = new GeneralNames(); CertificateIssuer certIssuer = new CertificateIssuer(); certIssuer.setIssuer(issuer);
public CertificateIssuer(GeneralNames issuer)
CertificateIssuer
from the given issuer name.
For instance:
GeneralNames issuer = ...; CertificateIssuer certificateIssuer = new CertificateIssuer(issuer);
issuer
- the certificate issuer to be setpublic CertificateIssuer(Name issuerDN)
CertificateIssuer
from the given issuer dn.
This contstructor may be used if the certificate issuer GeneralNames
is of type directoryName
(like, for instance, for a X.509
public key certificate), e.g.:
X509Certificate cert = ...; Name issuerDN = (Name)cert.getIssuerDN(); CertificateIssuer certificateIssuer = new CertificateIssuer(issuerDN);
issuerDN
- the certificate issuer to be setpublic ObjectID getObjectID()
CertificateIssuer
extensiongetObjectID
in class V3Extension
public void init(ASN1Object obj) throws X509ExtensionException
CertificateIssuer
implementation with an ASN1object
representing the value of this extension.
The given ASN1Object represents a GeneralNames giving the certificate issuer.
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
CertificateIssuer 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 CertificateIssuer as ASN1ObjectX509ExtensionException
- if the extension cannot be initpublic ASN1Object toASN1Object() throws X509ExtensionException
CertificateIssuer
extension object.
The returned ASN1Object is an ASN.1 GeneralNames representing the certificate issuer:
certificateIssuer ::= GeneralNames
toASN1Object
in class V3Extension
CertificateIssuer
as ASN1ObjectX509ExtensionException
- if an error occurs when parsing the supplied
ASN.1 objectpublic void setIssuer(GeneralNames issuer)
CertificateIssuer
object.
For instance:
CertificateIssuer certificateIssuer = new CertificateIssuer(); GeneralNames issuer = ...; certificateIssuer.setIssuer(issuer);
issuer
- the certificate issuer to be setpublic void setIssuerDN(Name issuerDN)
CertificateIssuer
object.
This method may be used if the certificate issuer GeneralNames
is of type directoryName
(like, for instance, for a X.509
public key certificate), e.g.:
X509Certificate cert = ...; Name issuerDN = (Name)cert.getIssuerDN(); CertificateIssuer certificateIssuer = new CertificateIssuer(); certificateIssuer.setIssuerDN(issuerDN);
issuerDN
- the certificate issuer dnpublic GeneralNames getIssuer()
public Name getIssuerDN()
CertificateIssuer
object.
This method may be used if the certificate issuer GeneralNames
is of type directoryName
(like, for instance, for a X.509
public key certificate).public int hashCode()
hashCode
in class V3Extension
public java.lang.String toString()
CertificateIssuer
extension.toString
in class java.lang.Object