示例#1
0
def decode_tst(tst_bytes):
    """
    Decodes Timestamp Token
    """
    tst = TSTInfo()
    decoded = decode(tst_bytes, asn1Spec=tst)
    tst = decoded[0]

    return tst
示例#2
0
def decode_qts(qts_bytes):
    """
    Decodes qualified timestamp
    """
    qts = Qts()
    decoded = decode(qts_bytes, asn1Spec=qts)
    qts = decoded[0]

    return qts
示例#3
0
def decode_qts(qts_bytes):
    '''
    Decodes qualified timestamp
    '''
    qts = Qts()
    decoded = decode(qts_bytes, asn1Spec=qts)
    qts = decoded[0]

    return qts
示例#4
0
def decode_tst(tst_bytes):
    '''
    Decodes Timestamp Token
    '''
    tst = TSTInfo()
    decoded = decode(tst_bytes, asn1Spec=tst)
    tst = decoded[0]

    return tst
示例#5
0
def decode_msg(message):
    """
    Decodes message in DER encoding.
    Returns ASN1 message object
    """
    # create template for decoder
    msg = Message()
    # decode pkcs signed message
    mess_obj = StringIO(message)
    mess_view = StringView(mess_obj, 0, len(message))
    decoded = decode(mess_view, asn1Spec=msg)
    message = decoded[0]
    return message
示例#6
0
def decode_msg(message):
    '''
    Decodes message in DER encoding.
    Returns ASN1 message object
    '''
    # create template for decoder
    msg = Message()
    # decode pkcs signed message
    mess_obj = StringIO(message)
    mess_view = StringView(mess_obj, 0, len(message))
    decoded = decode(mess_view, asn1Spec=msg)
    message = decoded[0]
    return message