|
Bouncy Castle Cryptography Library 1.85 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.bouncycastle.asn1.ASN1Object
org.bouncycastle.asn1.cms.BinaryTime
RFC 6019
type — the unsigned integer count of seconds since 1970-01-01T00:00:00Z (UTC).
BinaryTime ::= INTEGER (0..MAX)
Used by other LAMPS specifications that need a compact, monotonically
increasing time value as part of an ASN.1 structure (e.g. RFC 9763
RequesterCertificate.requestTime).
The companion CMS signed attribute OID is
available as
PKCSObjectIdentifiers.pkcs_9_at_binarySigningTime.
| Constructor Summary | |
BinaryTime(ASN1Integer time)
|
|
BinaryTime(java.util.Date date)
Construct a BinaryTime carrying the seconds-since-epoch of the supplied Date. |
|
BinaryTime(long seconds)
Construct a BinaryTime carrying the supplied count of seconds since 1970-01-01T00:00:00Z (UTC). |
|
| Method Summary | |
static BinaryTime |
getInstance(java.lang.Object obj)
|
ASN1Integer |
getTime()
|
ASN1Primitive |
toASN1Primitive()
Method providing a primitive representation of this object suitable for encoding. |
java.util.Date |
toDate()
Convert the encoded value to a Date. |
| Methods inherited from class org.bouncycastle.asn1.ASN1Object |
encodeTo, encodeTo, equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public BinaryTime(java.util.Date date)
Date. Sub-second components are discarded by truncation toward
negative infinity (consistent with Date.getTime() / 1000).
java.lang.IllegalArgumentException - if is before the epoch
(RFC 6019 prohibits negative values).public BinaryTime(long seconds)
java.lang.IllegalArgumentException - if is negative.public BinaryTime(ASN1Integer time)
| Method Detail |
public static BinaryTime getInstance(java.lang.Object obj)
public ASN1Integer getTime()
toDate() which rejects unrepresentable values.public java.util.Date toDate()
Date.
java.lang.ArithmeticException - if the seconds value does not fit in a
after multiplication by 1000.public ASN1Primitive toASN1Primitive()
ASN1Object
toASN1Primitive in interface ASN1EncodabletoASN1Primitive in class ASN1Object
|
Bouncy Castle Cryptography Library 1.85 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||