|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object iaik.asn1.structures.AttributeValue iaik.cms.attributes.SigningTime
public class SigningTime
The CMS SigningTime attribute.
The Cryptographic Message Syntax (CMS) (RFC 5652)
specifies the SigningTime
attribute to may be included as an signed attribute in a
SignerInfo
for specifying the time at which the signer (purportedly)
performed the signing process:
SigningTime ::= Time Time ::= CHOICE { utcTime UTCTime, generalizedTime GeneralizedTime }Dates between 1 January 1950 and 31 December 2049 (inclusive) must be encoded as UTCTime. Any dates with year values before 1950 or after 2049 must be encoded as GeneralizedTime.
Depending on the Date value supplied when creating
a SigningTime
attribute this class automatically decides whether UTCTime or GeneralizedTime has to be
used when later encoding the SigningTime:
Date time = ...; SigningTime signingTime = new SigningTime(time);
SignerInfo
Field Summary | |
---|---|
static ObjectID |
oid
The attributeType object identifier of the CMS SigningTime attribute. |
Constructor Summary | |
---|---|
SigningTime()
Creates a SigningTime for the current date. |
|
SigningTime(ASN1Object obj)
Creates an CMS SigningTime from its ASN.1 representation. |
|
SigningTime(java.util.Date time)
Creates a CMS SigningTime attribute for the time value. |
|
SigningTime(java.util.Date time,
ASN encodingType)
Creates a CMS SigningTime attribute for the given Date using the specified encoding type. |
Method Summary | |
---|---|
void |
decode(ASN1Object obj)
Decodes the given ASN.1 SigningTime object for parsing
the internal structure. |
boolean |
equals(java.lang.Object obj)
Compares this SigningTime to the specified object. |
java.util.Date |
get()
Returns the signing time. |
ObjectID |
getAttributeType()
Returns the OID identifying the SigningTime attribute type. |
int |
hashCode()
Returns a hashcode for this object. |
boolean |
multipleAllowed()
Returns false since only one AttributeValue is
allowed in the SET OF AttributeValue of an SigningTime attribute. |
ASN1Object |
toASN1Object()
Returns this SigningTime as ASN1Object. |
java.lang.String |
toString()
Returns a string representation of this SigningTime. |
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
Constructor Detail |
---|
public SigningTime()
public SigningTime(java.util.Date time)
time
- the signing time valuepublic SigningTime(java.util.Date time, ASN encodingType)
When using this constructor be aware that according the CMS/SMIME spec, Dates between 1 January 1950 and 31 December 2049 (inclusive) must be encoded as UTCTime. Any dates with year values before 1950 or after 2049 must be encoded as GeneralizedTime. (See RFC 5652)
time
- the signing timeencodingType
- the encoding type, either UTCTime or GeneralizedTime
java.lang.IllegalArgumentException
- if the supplied encoding type is not UTCTime
or GeneralizedTimepublic SigningTime(ASN1Object obj) throws CodingException
obj
- the CMS SigningTime as ASN1Object
CodingException
- if an error occurs when parsing the ASN1ObjectMethod Detail |
---|
public java.util.Date get()
public void decode(ASN1Object obj) throws CodingException
SigningTime
object for parsing
the internal structure.
obj
- the SigningTime as ASN1Object
CodingException
- if an error occurs when parsing the ASN1Objectpublic ASN1Object toASN1Object() throws CodingException
CodingException
- if no time value has been setpublic ObjectID getAttributeType()
getAttributeType
in class AttributeValue
public boolean equals(java.lang.Object obj)
SigningTime
to the specified object.
The comparison is done based on the String representation.
equals
in class java.lang.Object
obj
- the object to compare this SigningTime
against.
true
, if the given object is equal to this
SigningTime
,
false
otherwisepublic int hashCode()
hashCode
in class java.lang.Object
public boolean multipleAllowed()
false
since only one AttributeValue is
allowed in the SET OF AttributeValue of an SigningTime attribute.
multipleAllowed
in class AttributeValue
false
since only one attribute value is allowedpublic 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 |