Class Time

java.lang.Object
org.bouncycastle.asn1.ASN1Object
org.bouncycastle.asn1.x509.Time
All Implemented Interfaces:
ASN1Choice, ASN1Encodable

public class Time
extends ASN1Object
implements ASN1Choice
  • Constructor Details

    • Time

      public Time​(ASN1Primitive time)
    • Time

      public Time​(Date date)
      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.
  • Method Details

    • getInstance

      public static Time getInstance​(ASN1TaggedObject obj, boolean explicit)
    • getInstance

      public static Time getInstance​(Object obj)
    • getTime

      public String getTime()
    • getDate

      public Date getDate()
    • toASN1Primitive

      public ASN1Primitive toASN1Primitive()
      Produce an object suitable for an ASN1OutputStream.
       Time ::= CHOICE {
                   utcTime        UTCTime,
                   generalTime    GeneralizedTime }
       
      Specified by:
      toASN1Primitive in interface ASN1Encodable
      Specified by:
      toASN1Primitive in class ASN1Object
    • toString

      public String toString()
      Description copied from class: Object
      Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:
         getClass().getName() + '@' + Integer.toHexString(hashCode())

      See Writing a useful toString method if you intend implementing your own toString method.

      Overrides:
      toString in class Object
      Returns:
      a printable representation of this object.