|
IAIK CMS/SMIME Toolkit API Documentation
Version 6.1 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectiaik.cms.IssuerAndSerialNumber
public class IssuerAndSerialNumber
This class implements the CMS IssuerAndSerialNumber type.
The Cryptographic Message Syntax (CMS) (RFC 5652)
specifies the IssuerAndSerialNumber type for identifying a certificate
(and thereby an entity and a public key) by the distinguished name of the certificate
issuer and an issuer-specific certificate serial number:
IssuerAndSerialNumber ::= SEQUENCE {
issuer Name,
serialNumber CertificateSerialNumber }
The IssuerAndSerialNumber type maybe used for specifying the
signer certificate in the CMS SignerInfo structure,
the recipient's certificate in the CMS RecipientInfo
structure, or the originator in the CMS KeyAgreeRecipientInfo
structure.
SignerInfo,
RecipientInfo| Field Summary |
|---|
| Fields inherited from interface iaik.cms.KeyIdentifier |
|---|
ISSUER_AND_SERIALNUMBER, KEK_IDENTIFIER, ORIGINATOR_PUBLIC_KEY, RECIPIENT_KEY_IDENTIFIER, SUBJECT_KEY_IDENTIFIER |
| Constructor Summary | |
|---|---|
IssuerAndSerialNumber()
Default Constructor. |
|
IssuerAndSerialNumber(iaik.asn1.ASN1Object obj)
Creates a new IssuerAndSerialNumber from an ASN1Object. |
|
IssuerAndSerialNumber(iaik.asn1.structures.Name issuer,
java.math.BigInteger serialNumber)
Creates a new IssuerAndSerialNumber from an issuer
distinguished name and an issuer-specific serial number. |
|
IssuerAndSerialNumber(iaik.x509.X509Certificate cert)
Creates a new IssuerAndSerialNumber from a certificate. |
|
| Method Summary | |
|---|---|
void |
decode(iaik.asn1.ASN1Object obj)
Decodes the given ASN.1 IssuerAndSerialNumber object for parsing
the internal structure. |
boolean |
equals(java.lang.Object obj)
Compares this IssuerAndSerialNumber to the specified object. |
iaik.asn1.structures.Name |
getIssuer()
Returns the issuer distinguished name. |
int |
getKeyIdType()
Returns the key (certificate) identifier type this class represents. |
java.lang.String |
getKeyIdTypeName()
Returns the key (certificate) identifier type this class represents as string. |
java.math.BigInteger |
getSerialNumber()
Returns the issuer-specific serial number. |
int |
hashCode()
Returns a hashcode for this IssuerAndSerialNumber. |
boolean |
identifiesCert(iaik.x509.X509Certificate certificate)
Checks if the given certificate is identified by this IssuerAndSerialNumber. |
boolean |
isIssuerOf(iaik.x509.X509Certificate certificate)
Checks if the issuer of this IssuerAndSerialNumber has issued
the given certificate. |
iaik.asn1.ASN1Object |
toASN1Object()
Returns this IssuerAndSerialNumber as ASN1Object. |
java.lang.String |
toString()
Returns a string giving some information about this IssuerAndSerialNumber object. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IssuerAndSerialNumber()
public IssuerAndSerialNumber(iaik.asn1.structures.Name issuer,
java.math.BigInteger serialNumber)
IssuerAndSerialNumber from an issuer
distinguished name and an issuer-specific serial number.
Issuer distinguished name and issuer-specific serial number may be obtained from a certificate, or may be supplied immediatly, e.g.:
Name issuerDN = new Name();
issuerDN.addRDN(ObjectID.country, "AT");
issuerDN.addRDN(ObjectID.organization ,"TU Graz");
issuerDN.addRDN(ObjectID.organizationalUnit ,"IAIK");
issuerDN.addRDN(ObjectID.commonName ,"IAIK Test CA");
IssuerAndSerialNumber issuer_and_serialNr =
new IssuerAndSerialNumber(issuerDN, BigInteger.valueOf(0x12345));
issuer - the issuer distinguished nameserialNumber - the issuer-specific serial numberpublic IssuerAndSerialNumber(iaik.x509.X509Certificate cert)
IssuerAndSerialNumber from a certificate.
Issuer distinguished name and issuer-specific serial number are derived from the given certificate.
cert - the X509Certificate
public IssuerAndSerialNumber(iaik.asn1.ASN1Object obj)
throws iaik.asn1.CodingException
IssuerAndSerialNumber from an ASN1Object.
The ASN1Object supplied to this constructor represents an
already exisiting IssuerAndSerialNumber object that may
have been created by calling toASN1Object.
obj - the IssuerAndSerialNumber as ASN1Object
iaik.asn1.CodingException - if the ASN1Object could not be parsed| Method Detail |
|---|
public void decode(iaik.asn1.ASN1Object obj)
throws iaik.asn1.CodingException
IssuerAndSerialNumber object for parsing
the internal structure.
This method internally is called when creating a IssuerAndSerialNumber
object from an already existing IssuerAndSerialNumber object,
supplied as ASN1Object.
decode in interface iaik.asn1.ASN1Typeobj - the CMS IssuerAndSerialNumber as ASN1Object
iaik.asn1.CodingException - if the object can not be parsedpublic iaik.asn1.ASN1Object toASN1Object()
IssuerAndSerialNumber as ASN1Object.
The ASN1Object returned by this method may be used as parameter value
when creating an IssuerAndSerialNumber object using the
IssuerAndSerialNumber(ASN1Object obj)
constructor.
toASN1Object in interface iaik.asn1.ASN1TypeIssuerAndSerialNumber as ASN1Objectpublic int getKeyIdType()
getKeyIdType in interface KeyIdentifierpublic java.lang.String getKeyIdTypeName()
getKeyIdTypeName in interface KeyIdentifierpublic iaik.asn1.structures.Name getIssuer()
public java.math.BigInteger getSerialNumber()
public boolean equals(java.lang.Object obj)
IssuerAndSerialNumber to the specified object.
equals in interface KeyIdentifierequals in class java.lang.Objectobj - the object to compare this IssuerAndSerialNumber
against.
true, if the given object is equal to this
IssuerAndSerialNumber,
false otherwisepublic int hashCode()
hashCode in interface KeyIdentifierhashCode in class java.lang.Objectpublic boolean isIssuerOf(iaik.x509.X509Certificate certificate)
IssuerAndSerialNumber has issued
the given certificate.
certificate - the certificate to be checked of being issued by the
issuer of this IssuerAndSerialNumber
true if the issuer of this
IssuerAndSerialNumber has issued
the given certificate, false
otherwisepublic boolean identifiesCert(iaik.x509.X509Certificate certificate)
isIssuerOf this method checks
if the issuer of this IssuerAndSerialNumber has issued
the given certificate.
identifiesCert in interface CertificateIdentifiercertificate - the certificate to be checked of being issued by the
issuer of this IssuerAndSerialNumber
true if the issuer of this
IssuerAndSerialNumber has issued
the given certificate, false
otherwisepublic java.lang.String toString()
IssuerAndSerialNumber object.
toString in interface KeyIdentifiertoString in class java.lang.Object
|
IAIK CMS/SMIME Toolkit API Documentation
Version 6.1 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
|
v6.1 (c) 2002 IAIK, (c) 2003 - 2025 SIC |
|