|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object iaik.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 ObjectID |
oid
The attributeType object identifier of this ContentIdentifier attribute. |
Constructor Summary | |
---|---|
ContentIdentifier()
Empty default constructor. |
|
ContentIdentifier(ASN1Object obj)
Creates an ContentIdentifier from its ASN.1 representation. |
|
ContentIdentifier(byte[] identifier)
Creates an ContentIdentifier for the given identifier bytes. |
|
ContentIdentifier(GeneralNames name)
Creates a ContentIdentifier from user name, date and random number. |
|
ContentIdentifier(GeneralNames name,
java.util.Date date,
byte[] rand)
Creates a ContentIdentifier from user name, date and random number. |
|
ContentIdentifier(GeneralNames name,
SecurityProvider securityProvider)
Creates a ContentIdentifier from user name, date and random number. |
|
ContentIdentifier(Name name)
Creates a ContentIdentifier from user distinguished name, date and random number. |
|
ContentIdentifier(Name name,
java.util.Date date,
byte[] rand)
Creates a ContentIdentifier from user ditinguished name, date and random number. |
|
ContentIdentifier(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(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. |
ObjectID |
getAttributeType()
Returns the OID identifying the ContentIdentifier attribute type. |
int |
hashCode()
Returns a hashcode for this ContentIdentifier. |
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 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 userpublic 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 identifierpublic 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 numberpublic ContentIdentifier(GeneralNames name) throws 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
CodingException
- if there occurs an error when encoding the GeneralNamepublic ContentIdentifier(GeneralNames name, SecurityProvider securityProvider) throws 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
CodingException
- if there occurs an error when encoding the GeneralNamepublic ContentIdentifier(GeneralNames name, java.util.Date date, byte[] rand) throws 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
CodingException
- if there occurs an error when encoding the GeneralNamepublic ContentIdentifier(Name name) throws 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
CodingException
- if there occurs an error when encoding the Namepublic ContentIdentifier(Name name, SecurityProvider securityProvider) throws 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
CodingException
- if there occurs an error when encoding the Namepublic ContentIdentifier(Name name, java.util.Date date, byte[] rand) throws 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
CodingException
public ContentIdentifier(ASN1Object obj)
obj
- the ContentIdentifier as ASN1ObjectMethod Detail |
---|
public byte[] get()
public boolean equals(java.lang.Object obj)
ContentIdentifier
to the specified object.
equals
in class ESSAttributeValue
obj
- the object to compare this ContentIdentifier
against.
true
, if the given object is equal to this
ContentIdentifier
,
false
otherwisepublic int hashCode()
hashCode
in class ESSAttributeValue
public void decode(ASN1Object obj)
ContentIdentifier
object for parsing
the internal structure.
obj
- the ContentIdentifier as ASN1Objectpublic ASN1Object toASN1Object()
public ObjectID getAttributeType()
getAttributeType
in class AttributeValue
public java.lang.String toString()
toString
in class AttributeValue
|
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 |