|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object iaik.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(ASN1Object obj)
Creates a new IssuerAndSerialNumber from an ASN1Object. |
|
IssuerAndSerialNumber(Name issuer,
java.math.BigInteger serialNumber)
Creates a new IssuerAndSerialNumber from an issuer
distinguished name and an issuer-specific serial number. |
|
IssuerAndSerialNumber(X509Certificate cert)
Creates a new IssuerAndSerialNumber from a certificate. |
Method Summary | |
---|---|
void |
decode(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. |
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(X509Certificate certificate)
Checks if the given certificate is identified by this IssuerAndSerialNumber. |
boolean |
isIssuerOf(X509Certificate certificate)
Checks if the issuer of this IssuerAndSerialNumber has issued
the given certificate. |
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(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(X509Certificate cert)
IssuerAndSerialNumber
from a certificate.
Issuer distinguished name and issuer-specific serial number are derived from the given certificate.
cert
- the X509Certificatepublic IssuerAndSerialNumber(ASN1Object obj) throws 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
CodingException
- if the ASN1Object could not be parsedMethod Detail |
---|
public void decode(ASN1Object obj) throws 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 ASN1Type
obj
- the CMS IssuerAndSerialNumber as ASN1Object
CodingException
- if the object can not be parsedpublic 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 ASN1Type
IssuerAndSerialNumber
as ASN1Objectpublic int getKeyIdType()
getKeyIdType
in interface KeyIdentifier
public java.lang.String getKeyIdTypeName()
getKeyIdTypeName
in interface KeyIdentifier
public Name getIssuer()
public java.math.BigInteger getSerialNumber()
public boolean equals(java.lang.Object obj)
IssuerAndSerialNumber
to the specified object.
equals
in interface KeyIdentifier
equals
in class java.lang.Object
obj
- the object to compare this IssuerAndSerialNumber
against.
true
, if the given object is equal to this
IssuerAndSerialNumber
,
false
otherwisepublic int hashCode()
hashCode
in interface KeyIdentifier
hashCode
in class java.lang.Object
public boolean isIssuerOf(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(X509Certificate certificate)
isIssuerOf
this method checks
if the issuer of this IssuerAndSerialNumber
has issued
the given certificate.
identifiesCert
in interface CertificateIdentifier
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 java.lang.String toString()
IssuerAndSerialNumber
object.
toString
in interface KeyIdentifier
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 |