示例#1
0
class X509_ExtPrivateKeyUsagePeriod(ASN1_Packet):
    ASN1_codec = ASN1_Codecs.BER
    ASN1_root = ASN1F_SEQUENCE(
        ASN1F_optional(
            ASN1F_GENERALIZED_TIME("notBefore",
                                   str(GeneralizedTime(-600)),
                                   implicit_tag=0x80)),
        ASN1F_optional(
            ASN1F_GENERALIZED_TIME("notAfter",
                                   str(GeneralizedTime(+86400)),
                                   implicit_tag=0x81)))
示例#2
0
class OCSP_SingleResponse(ASN1_Packet):
    ASN1_codec = ASN1_Codecs.BER
    ASN1_root = ASN1F_SEQUENCE(
        ASN1F_PACKET("certID", OCSP_CertID(), OCSP_CertID),
        ASN1F_PACKET("certStatus", OCSP_CertStatus(), OCSP_CertStatus),
        ASN1F_GENERALIZED_TIME("thisUpdate", ""),
        ASN1F_optional(
            ASN1F_GENERALIZED_TIME("nextUpdate", "", explicit_tag=0xa0)),
        ASN1F_optional(
            ASN1F_SEQUENCE_OF("singleExtensions",
                              None,
                              X509_Extension,
                              explicit_tag=0xa1)))
示例#3
0
class OCSP_RevokedInfo(ASN1_Packet):
    ASN1_codec = ASN1_Codecs.BER
    ASN1_root = ASN1F_SEQUENCE(
        ASN1F_GENERALIZED_TIME("revocationTime", ""),
        ASN1F_optional(
            ASN1F_PACKET("revocationReason", None,
                         X509_ExtReasonCode,
                         explicit_tag=0x80)))
示例#4
0
class SAPPSE_Cont(ASN1_Packet):
    """SAP PSEv2 Content definition"""
    ASN1_codec = ASN1_Codecs.BER
    ASN1_root = ASN1F_SEQUENCE(
        ASN1F_PACKET("algorithm_identifier", PKCS5_Algorithm_Identifier(),
                     PKCS5_Algorithm_Identifier),
        ASN1F_GENERALIZED_TIME("timestamp", None),
        ASN1F_INTEGER("unknown1", 1),
        ASN1F_SET_OF("pse_obj", SAPPSE_Obj(), SAPPSE_Obj),
    )
示例#5
0
class OCSP_ResponseData(ASN1_Packet):
    ASN1_codec = ASN1_Codecs.BER
    ASN1_root = ASN1F_SEQUENCE(
        ASN1F_optional(
            ASN1F_enum_INTEGER("version", 0, {0: "v1"}, explicit_tag=0x80)),
        ASN1F_PACKET("responderID", OCSP_ResponderID(), OCSP_ResponderID),
        ASN1F_GENERALIZED_TIME("producedAt", str(GeneralizedTime())),
        ASN1F_SEQUENCE_OF("responses", [], OCSP_SingleResponse),
        ASN1F_optional(
            ASN1F_SEQUENCE_OF("responseExtensions",
                              None,
                              X509_Extension,
                              explicit_tag=0xa1)))
示例#6
0
class SAPPSE_Obj(ASN1_Packet):
    """SAP PSEv2 Object definition"""
    ASN1_codec = ASN1_Codecs.BER
    ASN1_root = ASN1F_SEQUENCE(
        ASN1F_PRINTABLE_STRING("object_name", "PKRoot"),
        ASN1F_GENERALIZED_TIME("created", None),
        ASN1F_OID("object_type", sappse_obj_oid["PKRoot"]),
        ASN1F_CHOICE_SAFE("object_value", None,
                     X509_SubjectPublicKeyInfo,               # SKnew, SKold, DECSKnew, DECSKold, SignSK
                     X509_Cert,                               # Cert, SignCert, EncCert
                     SAPPSE_Obj_PKRoot,                       # PKRoot
                     SAPPSE_Obj_CertList,                     # CertList, CSet, SignCSet, EncCSet
                     #ASN1F_SET_OF("cert_pairs", None, X509_CertPair),       # CrossCSet
                     #ASN1F_SEQUENCE_OF("forward_certification_path", None,  # FCPath
                     #                  ASN1F_SET_OF("cross_certs", None,
                     #                               X509_Cert)),
                     #ASN1F_SET_OF("pklist", SAPPSE_Obj_PKList(), SAPPSE_Obj_PKList),  # PKList, EKList, PCAList
                     #ASN1F_SET_OF("crlset", SAPPSE_Obj_CRLSet(), SAPPSE_Obj_CRLSet),  # CRLSet
                     #ASN1F_STRING("serial_number"),           # SerialNumber
                     #ASN1F_STRING("quipu_password"),          # QuipuPWD
                     #SAPPSE_Obj_EDBKey,                       # EDBKey
                     )
    )
示例#7
0
class X509_ExtInvalidityDate(ASN1_Packet):
    ASN1_codec = ASN1_Codecs.BER
    ASN1_root = ASN1F_GENERALIZED_TIME("invalidityDate", str(ZuluTime(+86400)))