public class IssuerSerial
extends java.lang.Object
IssuerSerial.
The
Internet Attribute Certificate Profile for Authorization
specifies the IssuerSerial type as an option for identifying
the holder or issuer of an attribute certificate by issuer name,
issuer-specific certificate serial number and optional issuerUniqueID
(see draft-ietf-pkix-ac509prof-06.txt):
IssuerSerial ::= SEQUENCE {
issuer GeneralNames,
serialNumber CertificateSerialNumber
issuerUID UniqueIdentifier OPTIONAL }
When used for identifying the Holder of an
attribute certificate, the issuer GeneralNames has to be created from the
issuerDN of the base certificate and the serial number has to be the same:
Holder ::= SEQUENCE {
baseCertificateID [0] IssuerSerial OPTIONAL,
-- the issuer and serial number of
-- the holder's Public Key Certificate
entityName [1] GeneralNames OPTIONAL,
-- the name of the claimant or role
objectDigestInfo [2] ObjectDigestInfo OPTIONAL
-- if present, version must be v2
}
When creating a IssuerSerial
object you may specifiy issuer GeneralNames, certificate serial number, or you
immediately may supply the base certificate and let the constructor calculate the GeneralNames issuer from the certificate´s IssuerDN:
X509Certificate baseCert = ...; IssuerSerial issuerSerial = new IssuerSerial(baseCert);The IssuerAndSerial option shall not be used for representing the issuer of an attribute certificate conforming to see draft-ietf-pkix-ac509prof-06.txt:
AttCertIssuer ::= CHOICE {
v1Form GeneralNames, -- v1 or v2
v2Form [0] V2Form -- v2 only
}
V2Form ::= SEQUENCE {
issuerName GeneralNames OPTIONAL,
baseCertificateID [0] IssuerSerial OPTIONAL,
objectDigestInfo [1] ObjectDigestInfo OPTIONAL
-- at least one of issuerName, baseCertificateID
-- or objectDigestInfo MUST be present
}
For representing the issuer the v1Form must be used.| Constructor and Description |
|---|
IssuerSerial(ASN1Object obj)
Creates a new
IssuerSerial from an ASN1Object. |
IssuerSerial(GeneralNames issuer,
java.math.BigInteger serialNumber)
Creates an IssuerSerial from issuer GeneralNames and
issuer-specific serial number.
|
IssuerSerial(Name issuer,
java.math.BigInteger serialNumber)
Creates a new
IssuerSerial from an issuer
distinguished name and issuer-specific serial number. |
IssuerSerial(X509Certificate baseCertificate)
Creates an IssuerSerial from the given base certificate.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Compares this
IssuerSerial to the specified object. |
GeneralNames |
getIssuer()
Returns the issuer GeneralNames.
|
boolean[] |
getIssuerUID()
Returns the issuer unique identifier, or
null if no
IssuerUniqueID is set. |
java.math.BigInteger |
getSerialNumber()
Returns the issuer-specific serial number.
|
int |
hashCode()
Returns a hashcode for this IssuerSerial.
|
boolean |
identifiesCert(X509Certificate baseCertificate)
Checks if this IssuerSerial identifies the given base certificate.
|
void |
setIssuerUID(boolean[] id)
Sets the issuer unique ID.
|
ASN1Object |
toASN1Object()
Returns this
IssuerSerial as ASN1Object. |
java.lang.String |
toString()
Returns a string giving some information about this
IssuerSerial object. |
public IssuerSerial(GeneralNames issuer, java.math.BigInteger serialNumber)
issuer - the issuer GeneralNamesserialNumber - the issuer-specific serial numberpublic IssuerSerial(Name issuer, java.math.BigInteger serialNumber)
IssuerSerial from an issuer
distinguished name and issuer-specific serial number.
This constructor may be used for creating an IssuerSerial
object for identifying an X.509 certificate where the issuer is
given as Distinguished Name structure. The wrapping into a
GeneralNames object is done inside this constructor.
Assuming a cert given as iaik.x509.X509Certificate
instance an IssuerSerial may be created like:
// the x.509 cert
X509Certificate cert = ...;
// get the IssuerDN
Name issuerDN = (Name)cert.getIssuerDN();
// now create the IssuerSerial
IssuerSerial issuerSerial =
new IssuerSerial(issuerDN, cert.getSerialNumber());
issuer - the issuer distinguished nameserialNumber - the issuer-specific serial numberpublic IssuerSerial(X509Certificate baseCertificate)
baseCertificate - the base certificatepublic IssuerSerial(ASN1Object obj) throws CodingException
IssuerSerial from an ASN1Object.
The ASN1Object supplied to this constructor represents an
already exisiting IssuerSerial object that may
have been created by calling toASN1Object.
obj - the IssuerSerial as ASN1ObjectCodingException - if the ASN1Object could not be parsedpublic ASN1Object toASN1Object()
IssuerSerial as ASN1Object.
The ASN1Object returned by this method may be used as parameter value
when creating an IssuerSerial object using the
IssuerSerial(ASN1Object obj)
constructor.
IssuerSerial as ASN1Objectpublic GeneralNames getIssuer()
public java.math.BigInteger getSerialNumber()
public boolean[] getIssuerUID()
null if no
IssuerUniqueID is set.IssuerUID as array of booleans, or
null if no issuer unique identifier is setpublic void setIssuerUID(boolean[] id)
id - the unique identifier of the issuer as array of boolean valuespublic boolean equals(java.lang.Object obj)
IssuerSerial to the specified object.equals in class java.lang.Objectobj - the object to compare this IssuerSerial
against.true, if the given object is equal to this
IssuerSerial,
false otherwisepublic boolean identifiesCert(X509Certificate baseCertificate)
true if issuerDN and serialNumber of the
given base certificate match to issuer and serial number
of this IssuerSerial, false if not
if the cert contains the issuer unique identifer field, its
value is compared to the one of this IssuerSerialpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
IssuerSerial object.toString in class java.lang.Object