|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object iaik.smime.ess.ESSIssuerSerial
public class ESSIssuerSerial
This class implements the S/MIMEv3 ESS IssuerSerial
type.
The Enhanced Security Services
for S/MIMEv3 (ESS) (RFC 2634) specifies the IssuerSerial
type for identifying a certificate by issuer information and issuer-specific
certificate serial number:
IssuerSerial ::= SEQUENCE { issuer GeneralNames, serialNumber CertificateSerialNumber }
The IssuerSerial
type is used for -- beside a cert hash -- optoinally
identifying a certificate in an ESSCertID
object.
In contrast to the CMS IssuerAndSerialNumber
where the issuer field is defined as ASN.1 Name, the ESS type IssuerSerial
specifies the issuer field as GeneralNames
to also recognize attribute
certificates.
ESSCertID
,
SigningCertificate
,
IssuerAndSerialNumber
,
X509Certificate
,
AttributeCertificate
Constructor Summary | |
---|---|
ESSIssuerSerial(ASN1Object obj)
Creates a new IssuerSerial from an ASN1Object. |
|
ESSIssuerSerial(java.security.cert.Certificate cert)
Creates a IssuerSerial from the given X.509 public key or X.509 attribute certificate certificate. |
|
ESSIssuerSerial(GeneralNames issuer,
java.math.BigInteger serialNumber)
Creates an IssuerSerial from issuer GeneralNames and and issuer-specific serial number. |
|
ESSIssuerSerial(IssuerAndSerialNumber issuerAndSerialNumber)
Creates a new ESS IssuerSerial from a
CMS IssuerAndSerialNumber . |
|
ESSIssuerSerial(Name issuer,
java.math.BigInteger serialNumber)
Creates a new IssuerSerial from an issuer
distinguished name and issuer-specific serial number. |
Method Summary | |
---|---|
void |
decode(ASN1Object obj)
Decodes the given ASN.1 IssuerSerial object for parsing
the internal structure. |
boolean |
equals(java.lang.Object obj)
Compares this IssuerSerial to the specified object. |
GeneralNames |
getIssuer()
Returns the issuer GeneralNames. |
java.math.BigInteger |
getSerialNumber()
Returns the issuer-specific serial number. |
int |
hashCode()
Returns a hashcode for this IssuerSerial. |
boolean |
identifiesCert(java.security.cert.Certificate certificate)
Checks whether the given certificate is identified by this IssuerSerial. |
ASN1Object |
toASN1Object()
Returns this IssuerSerial as ASN1Object. |
java.lang.String |
toString()
Returns a string giving some information about this IssuerSerial object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ESSIssuerSerial(GeneralNames issuer, java.math.BigInteger serialNumber)
issuer
- the issuer GeneralNamesserialNumber
- the issuer-specific serial numberpublic ESSIssuerSerial(IssuerAndSerialNumber issuerAndSerialNumber)
IssuerSerial
from a
CMS IssuerAndSerialNumber
.
issuerAndSerialNumber
- the CMS IssuerAndSerialNumberpublic ESSIssuerSerial(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 ESSIssuerSerialy
may be created like:
// the x.509 cert X509Certificate cert = ...; // get the IssuerDN Name issuerDN = (Name)cert.getIssuerDN(); // now create the ESSIssuerSerial ESSIssuerSerial issuerSerial = new ESSIssuerSerial(issuerDN, cert.getSerialNumber());
issuer
- the issuer distinguished nameserialNumber
- the issuer-specific serial numberpublic ESSIssuerSerial(java.security.cert.Certificate cert) throws java.security.cert.CertificateException
Attention! Only X.509 public key certificates (instances of
iaik.x509.X509Certificate
) or X.509 attribute
certificates (instances of iaik.x409.attr.AttributeCertificate
)
can be handled by this constructor; PKCS#6 ExtendedCertificates are obsolete
and therefore not supported.
cert
- the certificate for which to create the IssuerSerial (either an
instance of iaik.x509.X509Certificate
or an instance of
iaik.x509.attr.AttributeCertificate
java.lang.IllegalArgumentException
- if the supplied certificate is not an
iaik.x509.X509Certificate
or
iaik.x509.attr.AttributeCertificate
java.security.cert.CertificateException
- if the given cert is an attribute certifcate but the
issuer information included is not sufficient to construct an IssuerSerial
(if V2Form is used for indicating the issuer, but not the issuerName option)public ESSIssuerSerial(ASN1Object obj) throws CodingException
IssuerSerial
from an ASN1Object.
The ASN1Object supplied to this constructor represents an
already exisiting ESSIssuerSerial
object that may
have been created by calling toASN1Object
.
obj
- the IssuerSerial
as ASN1Object
CodingException
- if the ASN1Object could not be parsedMethod Detail |
---|
public boolean identifiesCert(java.security.cert.Certificate certificate)
certificate
- the certificate to be checked (either an
instance of iaik.x509.X509Certificate
or an instance of
iaik.x509.attr.AttributeCertificate
true
if the given certificate is identified by
this IssuerSerial, false
if not
java.lang.IllegalArgumentException
- if the supplied certificate is not an
iaik.x509.X509Certificate
or
iaik.x509.attr.AttributeCertificate
public void decode(ASN1Object obj) throws CodingException
IssuerSerial
object for parsing
the internal structure.
This method internally is called when creating a ESSIssuerSerial
object from an already existing ESSIssuerSerial
object,
supplied as ASN1Object.
obj
- the ESS IssuerSerial as ASN1Object
CodingException
- if the object can not be parsedpublic ASN1Object toASN1Object()
IssuerSerial
as ASN1Object.
The ASN1Object returned by this method may be used as parameter value
when creating an ESSIssuerSerial
object using the
ESSIssuerSerial(ASN1Object obj)
constructor.
IssuerSerial
as ASN1Objectpublic GeneralNames getIssuer()
public java.math.BigInteger getSerialNumber()
public boolean equals(java.lang.Object obj)
IssuerSerial
to the specified object.
equals
in class java.lang.Object
obj
- the object to compare this IssuerSerial
against.
true
, if the given object is equal to this
IssuerSerial
,
false
otherwisepublic int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
IssuerSerial
object.
toString
in class java.lang.Object
|
This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |