Top Fields Constructors Methods
org.bouncycastle.asn1.x509

public Class Time

extends ASN1Object
implements ASN1Choice
Class Inheritance
All Implemented Interfaces
org.bouncycastle.asn1.ASN1Choice
Imports
java.text.ParseException, .SimpleDateFormat, java.util.Date, .Locale, .SimpleTimeZone, org.bouncycastle.asn1.ASN1Choice, .ASN1GeneralizedTime, .ASN1Object, .ASN1Primitive, .ASN1TaggedObject, .ASN1UTCTime, .DERGeneralizedTime, .DERUTCTime, .LocaleUtil

Field Summary

Modifier and TypeField and Description
pack-priv ASN1Primitive

Constructor Summary

AccessConstructor and Description
public
public
Time(Date
a date object representing the time of interest.
time
)

Creates a time object from a given date - if the date is between 1950 and 2049 a UTCTime object is generated, otherwise a GeneralizedTime is used.

public
Time(Date
a date object representing the time of interest.
time
,
Locale
an appropriate Locale for producing an ASN.1 GeneralizedTime value.
locale
)

Creates a time object from a given date and locale - if the date is between 1950 and 2049 a UTCTime object is generated, otherwise a GeneralizedTime is used.

Method Summary

Modifier and TypeMethod and Description
public Date
public static Time
getInstance(ASN1TaggedObject obj, boolean explicit)

public static Time
public String
public ASN1Primitive
toASN1Primitive()

Implements abstract org.bouncycastle.asn1.ASN1Object.toASN1Primitive.

Implements org.bouncycastle.asn1.ASN1Encodable.toASN1Primitive.

Produce an object suitable for an ASN1OutputStream.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from org.bouncycastle.asn1.ASN1Object:
encodeToencodeToequalsgetEncodedgetEncodedhasEncodedTagValuehashCode

Field Detail

timeback to summary
pack-priv ASN1Primitive time

Constructor Detail

Timeback to summary
public Time(ASN1Primitive time)
Timeback to summary
public Time(Date time)

Creates a time object from a given date - if the date is between 1950 and 2049 a UTCTime object is generated, otherwise a GeneralizedTime is used.

Parameters
time:Date

a date object representing the time of interest.

Timeback to summary
public Time(Date time, Locale locale)

Creates a time object from a given date and locale - if the date is between 1950 and 2049 a UTCTime object is generated, otherwise a GeneralizedTime is used. You may need to use this constructor if the default locale doesn't use a Gregorian calender so that the GeneralizedTime produced is compatible with other ASN.1 implementations.

Parameters
time:Date

a date object representing the time of interest.

locale:Locale

an appropriate Locale for producing an ASN.1 GeneralizedTime value.

Method Detail

getDateback to summary
public Date getDate()
getInstanceback to summary
public static Time getInstance(ASN1TaggedObject obj, boolean explicit)
getInstanceback to summary
public static Time getInstance(Object obj)
getTimeback to summary
public String getTime()
toASN1Primitiveback to summary
public ASN1Primitive toASN1Primitive()

Implements abstract org.bouncycastle.asn1.ASN1Object.toASN1Primitive.

Implements org.bouncycastle.asn1.ASN1Encodable.toASN1Primitive.

Produce an object suitable for an ASN1OutputStream.

Time ::= CHOICE {
            utcTime        UTCTime,
            generalTime    GeneralizedTime }
Returns:ASN1Primitive

Doc from org.bouncycastle.asn1.ASN1Object.toASN1Primitive.

a primitive representation of this object.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object