Class Time

  • All Implemented Interfaces:
    io.anyline.nfc.bouncycastle.asn1.ASN1Choice , io.anyline.nfc.bouncycastle.asn1.ASN1Encodable , io.anyline.nfc.bouncycastle.util.Encodable

    
    public class Time
    extends ASN1Object implements ASN1Choice
                        

    RFC 5652: Dual-mode timestamp format producing either UTCTIme or GeneralizedTime.

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

    This has a constructor using java.util.Date for input which generates a DERUTCTime object if the supplied datetime is in range 1950-01-01-00:00:00 UTC until 2049-12-31-23:59:60 UTC. If the datetime value is outside that range, the generated object will be DERGeneralizedTime.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      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.
      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.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      static Time getInstance(ASN1TaggedObject obj, boolean explicit)
      static Time getInstance(Object obj) Return a Time object from the given object.
      String getTime() Get the date and time as a String in full form century format.
      Date getDate() Get java.util.Date version of date+time.
      ASN1Primitive toASN1Primitive() Produce an object suitable for an ASN1OutputStream.
      • Methods inherited from class io.anyline.nfc.bouncycastle.asn1.ASN1Object

        encodeTo, encodeTo, equals, getEncoded, getEncoded, hashCode
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Time

        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 - a date object representing the time of interest.
      • Time

        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.
        Parameters:
        time - a date object representing the time of interest.
        locale - an appropriate Locale for producing an ASN.1 GeneralizedTime value.