|
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.asn1.structures.AttributeValue
iaik.smime.ess.ESSAttributeValue
iaik.smime.ess.ContentIdentifier
public class ContentIdentifier
The S/MIMEv3 ESS ContentIdentifier attribute.
The Enhanced Security Services
for S/MIMEv3 (ESS) (RFC 2634) specifies the ContentIdentifier
attribute to may be included as an attribute in a SignerInfo to carry a unique identifier assigned to the message.
ContentIdentifier ::= OCTET STRING
id-aa-contentIdentifier OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) id-aa(2) 7}
When requesting a signed receipt from
a recipient the originator includes a signed content identifier for the
message in its ReceiptRequest attribute
to associate the signed receipt with the message requesting the signed receipt.
The receipient copies the signed content identifier of the received ReceiptRequest atribute into its signed receipt attribute to be sent back to
the originator.
This class provides three constructors for creating a new ContentIdentifier.
The first one allows to immediately set
the content identifier bytes:
byte[] identifier = ...; ContentIdentifier contentIdentifier = new ContentIdentifier(identifier);The other two constructors may be used to create minimal signed content identifiers as described above from public
keying material or user name and GeneralizedTime string and public number, e.g.:
// the public key of the user PublicKey publicKey = ...; // the date from which to create the GeneralizedTime Date date = ...; // a random number byte[] rand = ...; ContentIdentifier contentIdentifier = new ContentIdentifier(publicKey, date, rand);
| Field Summary | |
|---|---|
static iaik.asn1.ObjectID |
oid
The attributeType object identifier of this ContentIdentifier attribute. |
| Constructor Summary | |
|---|---|
ContentIdentifier()
Empty default constructor. |
|
ContentIdentifier(iaik.asn1.ASN1Object obj)
Creates an ContentIdentifier from its ASN.1 representation. |
|
ContentIdentifier(byte[] identifier)
Creates an ContentIdentifier for the given identifier bytes. |
|
ContentIdentifier(iaik.asn1.structures.GeneralNames name)
Creates a ContentIdentifier from user name, date and random number. |
|
ContentIdentifier(iaik.asn1.structures.GeneralNames name,
java.util.Date date,
byte[] rand)
Creates a ContentIdentifier from user name, date and random number. |
|
ContentIdentifier(iaik.asn1.structures.GeneralNames name,
SecurityProvider securityProvider)
Creates a ContentIdentifier from user name, date and random number. |
|
ContentIdentifier(iaik.asn1.structures.Name name)
Creates a ContentIdentifier from user distinguished name, date and random number. |
|
ContentIdentifier(iaik.asn1.structures.Name name,
java.util.Date date,
byte[] rand)
Creates a ContentIdentifier from user ditinguished name, date and random number. |
|
ContentIdentifier(iaik.asn1.structures.Name name,
SecurityProvider securityProvider)
Creates a ContentIdentifier from user distinguished name, date and random number. |
|
ContentIdentifier(java.security.PublicKey publicKey)
Creates a ContentIdentifier from the given public keying material. |
|
ContentIdentifier(java.security.PublicKey publicKey,
java.util.Date date,
byte[] rand)
Creates a ContentIdentifier from public keying material, date and random number. |
|
ContentIdentifier(java.security.PublicKey publicKey,
SecurityProvider securityProvider)
Creates a ContentIdentifier from the given public keying material. |
|
| Method Summary | |
|---|---|
void |
decode(iaik.asn1.ASN1Object obj)
Decodes the given ASN.1 ContentIdentifier object for parsing
the internal structure. |
boolean |
equals(java.lang.Object obj)
Compares this ContentIdentifier to the specified object. |
byte[] |
get()
Returns the identifier bytes. |
iaik.asn1.ObjectID |
getAttributeType()
Returns the OID identifying the ContentIdentifier attribute type. |
int |
hashCode()
Returns a hashcode for this ContentIdentifier. |
iaik.asn1.ASN1Object |
toASN1Object()
Returns this ContentIdentifier as ASN1Object. |
java.lang.String |
toString()
Returns a string representation of this ContentIdentifier. |
| Methods inherited from class iaik.smime.ess.ESSAttributeValue |
|---|
multipleAllowed |
| Methods inherited from class iaik.asn1.structures.AttributeValue |
|---|
getName |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final iaik.asn1.ObjectID oid
ContentIdentifier attribute.
The corresponding OID string is "1.2.840.113549.1.9.16.2.7".
| Constructor Detail |
|---|
public ContentIdentifier()
public ContentIdentifier(byte[] identifier)
identifier - the bytes identifying the contentpublic ContentIdentifier(java.security.PublicKey publicKey)
The ContentIdentifier is an attribute (OCTET STRING) used to carry a
unique identifier assigned to the message. To ensure global uniqueness, the
minimal signedContentIdentifier SHOULD contain a concatenation of
user-specific identification information (such as a user name or
public keying material identification information), a GeneralizedTime
string, and a random number.
This constructor may be used for creating a minimal signedContentIdentifier
from the given user keying material; GeneralizedTime is set to the current date
and random number is calculated as 16 byte random. Use this constructor if you yourself want
to set date and random number.
publicKey - the public key of the user
public ContentIdentifier(java.security.PublicKey publicKey,
SecurityProvider securityProvider)
The ContentIdentifier is an attribute (OCTET STRING) used to carry a
unique identifier assigned to the message. To ensure global uniqueness, the
minimal signedContentIdentifier SHOULD contain a concatenation of
user-specific identification information (such as a user name or
public keying material identification information), a GeneralizedTime
string, and a random number.
This constructor may be used for creating a minimal signedContentIdentifier
from the given user keying material; GeneralizedTime is set to the current date
and random number is calculated as 16 byte random. Use this constructor if you yourself want
to set date and random number.
publicKey - the public key of the usersecurityProvider - the SecurityProvider to be used by this object (only required if no rand
is supplied), if null use the default system-wide installed
SecurityProvider; this constructor may use the SecurityProvider method getSecureRandom() to calculate
the random number used for building the identifier
public ContentIdentifier(java.security.PublicKey publicKey,
java.util.Date date,
byte[] rand)
The ContentIdentifier is an attribute (OCTET STRING) used to carry a unique identifier assigned to the message. To ensure global uniqueness, the minimal signedContentIdentifier SHOULD contain a concatenation of user-specific identification information (such as a user name or public keying material identification information), a GeneralizedTime string, and a random number. This constructor may be used for creating a minimal signedContentIdentifier from user keying material, GeneralizedTime date and random number.
publicKey - the public key of the userdate - the date to be encoded as GeneralizedTimerand - a random number
public ContentIdentifier(iaik.asn1.structures.GeneralNames name)
throws iaik.asn1.CodingException
The ContentIdentifier is an attribute (OCTET STRING) used to carry a
unique identifier assigned to the message. To ensure global uniqueness, the
minimal signedContentIdentifier SHOULD contain a concatenation of
user-specific identification information (such as a user name or
public keying material identification information), a GeneralizedTime
string, and a random number.
This constructor may be used for creating a minimal signedContentIdentifier
from the given user name; GeneralizedTime is set to the current date
and random number is calculated as 16 byte random. Use this constructor if you yourself want
to set date and random number.
name - the name of the user
iaik.asn1.CodingException - if there occurs an error when encoding the GeneralName
public ContentIdentifier(iaik.asn1.structures.GeneralNames name,
SecurityProvider securityProvider)
throws iaik.asn1.CodingException
The ContentIdentifier is an attribute (OCTET STRING) used to carry a
unique identifier assigned to the message. To ensure global uniqueness, the
minimal signedContentIdentifier SHOULD contain a concatenation of
user-specific identification information (such as a user name or
public keying material identification information), a GeneralizedTime
string, and a random number.
This constructor may be used for creating a minimal signedContentIdentifier
from the given user name; GeneralizedTime is set to the current date
and random number is calculated as 16 byte random. Use this constructor if you yourself want
to set date and random number.
name - the name of the usersecurityProvider - the SecurityProvider to be used by this object (only required if no rand
is supplied), if null use the default system-wide installed
SecurityProvider; this constructor may use the SecurityProvider method getSecureRandom() to calculate
the random number used for building the identifier
iaik.asn1.CodingException - if there occurs an error when encoding the GeneralName
public ContentIdentifier(iaik.asn1.structures.GeneralNames name,
java.util.Date date,
byte[] rand)
throws iaik.asn1.CodingException
The ContentIdentifier is an attribute (OCTET STRING) used to carry a unique identifier assigned to the message. To ensure global uniqueness, the minimal signedContentIdentifier SHOULD contain a concatenation of user-specific identification information (such as a user name or public keying material identification information), a GeneralizedTime string, and a random number. This constructor may be used for creating a minimal signedContentIdentifier from user name, GeneralizedTime date and random number.
name - the name of the userdate - the date to be encoded as GeneralizedTimerand - a random number
iaik.asn1.CodingException - if there occurs an error when encoding the GeneralName
public ContentIdentifier(iaik.asn1.structures.Name name)
throws iaik.asn1.CodingException
The ContentIdentifier is an attribute (OCTET STRING) used to carry a
unique identifier assigned to the message. To ensure global uniqueness, the
minimal signedContentIdentifier SHOULD contain a concatenation of
user-specific identification information (such as a user name or
public keying material identification information), a GeneralizedTime
string, and a random number.
This constructor may be used for creating a minimal signedContentIdentifier
from the given user name; GeneralizedTime is set to the current date
and random number is calculated as 16 byte random. Use this constructor if you yourself want
to set date and random number.
name - the ditinguished name of the user
iaik.asn1.CodingException - if there occurs an error when encoding the Name
public ContentIdentifier(iaik.asn1.structures.Name name,
SecurityProvider securityProvider)
throws iaik.asn1.CodingException
The ContentIdentifier is an attribute (OCTET STRING) used to carry a
unique identifier assigned to the message. To ensure global uniqueness, the
minimal signedContentIdentifier SHOULD contain a concatenation of
user-specific identification information (such as a user name or
public keying material identification information), a GeneralizedTime
string, and a random number.
This constructor may be used for creating a minimal signedContentIdentifier
from the given user name; GeneralizedTime is set to the current date
and random number is calculated as 16 byte random. Use this constructor if you yourself want
to set date and random number.
name - the ditinguished name of the usersecurityProvider - the SecurityProvider to be used by this object (only required if no rand
is supplied), if null use the default system-wide installed
SecurityProvider; this constructor may use the SecurityProvider method getSecureRandom() to calculate
the random number used for building the identifier
iaik.asn1.CodingException - if there occurs an error when encoding the Name
public ContentIdentifier(iaik.asn1.structures.Name name,
java.util.Date date,
byte[] rand)
throws iaik.asn1.CodingException
The ContentIdentifier is an attribute (OCTET STRING) used to carry a unique identifier assigned to the message. To ensure global uniqueness, the minimal signedContentIdentifier SHOULD contain a concatenation of user-specific identification information (such as a user name or public keying material identification information), a GeneralizedTime string, and a random number. This constructor may be used for creating a minimal signedContentIdentifier from user name, GeneralizedTime date and random number.
name - the ditinguished name of the userdate - the date to be encoded as GeneralizedTimerand - a random number
iaik.asn1.CodingExceptionpublic ContentIdentifier(iaik.asn1.ASN1Object obj)
obj - the ContentIdentifier as ASN1Object| Method Detail |
|---|
public byte[] get()
public boolean equals(java.lang.Object obj)
ContentIdentifier to the specified object.
equals in class ESSAttributeValueobj - the object to compare this ContentIdentifier
against.
true, if the given object is equal to this
ContentIdentifier,
false otherwisepublic int hashCode()
hashCode in class ESSAttributeValuepublic void decode(iaik.asn1.ASN1Object obj)
ContentIdentifier object for parsing
the internal structure.
obj - the ContentIdentifier as ASN1Objectpublic iaik.asn1.ASN1Object toASN1Object()
public iaik.asn1.ObjectID getAttributeType()
getAttributeType in class iaik.asn1.structures.AttributeValuepublic java.lang.String toString()
toString in class iaik.asn1.structures.AttributeValue
|
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 |
|