Time String Types

A Python class is generated for an ASN.1 time string type (GeneralizedTime or UTCTime) only if the type is tagged. This is only true for BER/DER encoding rules; in other cases, no class is generated.

If a class is generated, it will contain static methods for the BER encoding or decoding of a time string value.

Example ASN.1:

GT ::= [APPLICATION 2] GeneralizedString

Generated Python Class:

class GT:
    @staticmethod
    def ber_decode(decbuf, explicit=True, impllen=None):
    ...

    @staticmethod
    def ber_encode(value, encbuf, explicit=True):
    ...

The value that is returned by the decode method or passed into the encode method is a Python string value.

Note that the newer ASN.1 time types such as TIME, DATE, TIME-OF-DAY, etc. as documented in ITU-T X.680 Clause 38 are not supported in this release.

See the BER encode/decode methods for information on how to call these methods.