public class EntityIdentifier extends java.lang.Object implements CertificateIdentifier
The Enhanced Security Services
for S/MIMEv3 (ESS) (RFC 2634) specifies the EntityIdentifier
type for identifying the mailing list agent (MLA) to which a MLData of a MLExpansionHistory attribute
belongs. The identification may be done by IssuerAndSerialNumber or
SubjectKeyIdentifier:
EntityIdentifier ::= CHOICE {
issuerAndSerialNumber IssuerAndSerialNumber,
subjectKeyIdentifier SubjectKeyIdentifier }
When creating an EntityIdentifier
the entity has to be represented as IssuerAndSerialNumber or SubjectKeyID object, e.g.:
IssuerAndSerialNumber issuerAndSerialNumber = ...; EntityIdentifier entityID = new EntityIdentifier(issuerAndSerialNumber);
IssuerAndSerialNumber,
SubjectKeyID,
MLData,
MLExpansionHistoryISSUER_AND_SERIALNUMBER, KEK_IDENTIFIER, ORIGINATOR_PUBLIC_KEY, RECIPIENT_KEY_IDENTIFIER, SUBJECT_KEY_IDENTIFIER| Constructor and Description |
|---|
EntityIdentifier(iaik.asn1.ASN1Object obj)
Creates a EntityIdentifier from an ASN1Object.
|
EntityIdentifier(CertificateIdentifier identifier)
Creates a EntityIdentifier from the given IssuerAndSerialNumber
or SubjectKeyID.
|
| Modifier and Type | Method and Description |
|---|---|
void |
decode(iaik.asn1.ASN1Object obj)
Decodes the EntityIdentifier from the given ASN1Object.
|
boolean |
equals(java.lang.Object obj)
Compares this
EntityIdentifier to the specified object. |
CertificateIdentifier |
getCertificateIdentifier()
Gets the CertificateIdentifier this EntityIdentifier represents.
|
int |
getKeyIdType()
Returns the key identifier type this class represents.
|
java.lang.String |
getKeyIdTypeName()
Returns the key (certificate) identifier type this class represents as string.
|
int |
hashCode()
Returns a hashcode for this
EntityIdentifier. |
boolean |
identifiesCert(iaik.x509.X509Certificate cert)
Checks if the given certificate is identified by this CertificateIdentifier.
|
boolean |
isMailListIdentifierFor(MLData mlData)
Checks if this EntityIdentifier is a mail list identifier
for the given MLData.
|
iaik.asn1.ASN1Object |
toASN1Object()
Returns this EntityIdentifier as ASN1Object.
|
java.lang.String |
toString()
Returns a String representation of this EntityIdentifier.
|
public EntityIdentifier(CertificateIdentifier identifier)
Use an IssuerAndSerialNumber
or SubjectKeyID object for identifying
the entity, e.g.:
IssuerAndSerialNumber issuerAndSerialNumber = ...; EntityIdentifier entityID = new EntityIdentifier(issuerAndSerialNumber);
identifier - the IssuerAndSerialNumber or SubjectKeyID to
be used for identifying the MLAjava.lang.IllegalArgumentException - if the supplied identifier is not an
IssuerAndSerialNumber or SubjecKeyIdentifierpublic EntityIdentifier(iaik.asn1.ASN1Object obj)
throws iaik.asn1.CodingException
obj - the EntityIdentifier as ASN1Objectiaik.asn1.CodingException - if the ASN1Object cannot be decoded or
is invalid structuredpublic CertificateIdentifier getCertificateIdentifier()
public boolean identifiesCert(iaik.x509.X509Certificate cert)
identifiesCert in interface CertificateIdentifiercert - the certificate to be checked of being identified
by this CertificateIdentifiertrue if the given certificate is identified by this
CertificateIdentifier, false
otherwisepublic boolean isMailListIdentifierFor(MLData mlData)
mlData - the MLData which may belong to the MLA identified
by this EntityIdentifiertrue if the given MLData belongs to the MLA identified
by this EntityIdentifier, false if notpublic void decode(iaik.asn1.ASN1Object obj)
throws iaik.asn1.CodingException
decode in interface iaik.asn1.ASN1Typeobj - the EntityIdentifier as ASN1Objectiaik.asn1.CodingException - if the ASN1Object cannot be decoded or
is invalid structuredpublic iaik.asn1.ASN1Object toASN1Object()
toASN1Object in interface iaik.asn1.ASN1Typepublic boolean equals(java.lang.Object obj)
EntityIdentifier to the specified object.equals in interface KeyIdentifierequals in class java.lang.Objectobj - the object to compare this EntityIdentifier
against.true, if the given object is equal to this
EntityIdentifier,
false otherwisepublic int hashCode()
EntityIdentifier.hashCode in interface KeyIdentifierhashCode in class java.lang.ObjectEntityIdentifierpublic int getKeyIdType()
getKeyIdType in interface KeyIdentifierpublic java.lang.String getKeyIdTypeName()
getKeyIdTypeName in interface KeyIdentifierpublic java.lang.String toString()
toString in interface KeyIdentifiertoString in class java.lang.Object