class AttributeTypeAndValue(types.Sequence):
    print_labels = False
    print_delimiter = "="
    components = ((types.Component("type", AttributeType)),
                  (types.Component("value",
                                   AttributeValue,
                                   defined_by="type",
                                   lookup=_ATTRIBUTE_DICT)))
class ORAddress(types.Sequence):
    components = ((types.Component("builtInStandardAttributes", types.Any)),
                  (types.Component("builtInDomainDefinedAttributes",
                                   BuiltInDomainDefinedAttributes,
                                   optional=True)),
                  (types.Component("extensionAttributes",
                                   ExtensionAttributes,
                                   optional=True)))
Exemple #3
0
class PolicyQualifierInfo(types.Sequence):
    print_labels = False
    print_delimiter = ": "
    components = (types.Component(POLICY_QUALIFIER_ID, oid.ObjectIdentifier),
                  types.Component(QUALIFIER,
                                  types.Any,
                                  defined_by="policyQualifierId",
                                  lookup=_POLICY_QUALIFIER_DICT))
Exemple #4
0
class Extension(types.Sequence):
    print_delimiter = ", "
    components = (types.Component("extnID", oid.ObjectIdentifier),
                  types.Component("critical", types.Boolean, default=False),
                  types.Component("extnValue",
                                  ExtensionValue,
                                  defined_by="extnID",
                                  lookup=_EXTENSION_DICT))
class DummySequence(types.Sequence):
    LOOK = {True: types.Integer}
    components = (
        types.Component("bool", types.Boolean),
        types.Component("int", types.Integer, optional=True),
        types.Component("oct", types.OctetString, default="hi"),
        types.Component("any", types.Any, defined_by="bool", lookup=LOOK)
      )
Exemple #6
0
class DistributionPoint(types.Sequence):
    components = (types.Component(DISTRIBUTION_POINT,
                                  DistributionPointName.explicit(0),
                                  optional=True),
                  types.Component(REASONS,
                                  ReasonFlags.implicit(1),
                                  optional=True),
                  types.Component(CRL_ISSUER,
                                  x509_name.GeneralNames.implicit(2),
                                  optional=True))
Exemple #7
0
class AuthorityKeyIdentifier(types.Sequence):
    components = (types.Component(KEY_IDENTIFIER,
                                  KeyIdentifier.implicit(0),
                                  optional=True),
                  types.Component(AUTHORITY_CERT_ISSUER,
                                  x509_name.GeneralNames.implicit(1),
                                  optional=True),
                  types.Component(
                      AUTHORITY_CERT_SERIAL_NUMBER,
                      x509_common.CertificateSerialNumber.implicit(2),
                      optional=True))
class EDIPartyName(types.Sequence):
    print_delimiter = ", "
    components = (
        # Definition here: http://tools.ietf.org/html/rfc5280#section-4.2.1.6
        # Note: this definition suggests that the tagging is implicit.
        # However, implicit tagging of a CHOICE type is ambiguous, so this is
        # in practice interpreted as an explicit tag.
        (types.Component("nameAssigner",
                         DirectoryString.explicit(0),
                         optional=True)),
        (types.Component("partyName", DirectoryString.explicit(1))))
Exemple #9
0
class TBSCertificate(types.Sequence):
    components = ((types.Component("version",
                                   x509_common.Version.explicit(0),
                                   default=0)), (types.Component(
                                       "serialNumber",
                                       x509_common.CertificateSerialNumber)),
                  (types.Component("signature",
                                   x509_common.AlgorithmIdentifier)),
                  (types.Component("issuer", x509_name.Name)),
                  (types.Component("validity", x509_time.Validity)),
                  (types.Component("subject", x509_name.Name)),
                  (types.Component("subjectPublicKeyInfo",
                                   x509_common.SubjectPublicKeyInfo)),
                  (types.Component("issuerUniqueID",
                                   x509_common.UniqueIdentifier.implicit(1),
                                   optional=True)),
                  (types.Component("subjectUniqueID",
                                   x509_common.UniqueIdentifier.implicit(2),
                                   optional=True)), (types.Component(
                                       "extensions",
                                       x509_extension.Extensions.explicit(3),
                                       optional=True)))
Exemple #10
0
class Certificate(types.Sequence):
    components = ((types.Component("tbsCertificate", TBSCertificate)),
                  (types.Component("signatureAlgorithm",
                                   x509_common.AlgorithmIdentifier)),
                  (types.Component("signatureValue", types.BitString)))
class _ECDSASignature(types.Sequence):
    components = ((types.Component("r", types.Integer)),
                  (types.Component("s", types.Integer)))
class SubjectPublicKeyInfo(types.Sequence):
    components = (
        (types.Component("algorithm", AlgorithmIdentifier)),
        (types.Component("subjectPublicKey", types.BitString))
        )
class AlgorithmIdentifier(types.Sequence):
    components = (
        (types.Component("algorithm", oid.ObjectIdentifier)),
        (types.Component("parameters", types.Any, optional=True))
        )
Exemple #14
0
class UserNotice(types.Sequence):
    components = (types.Component(NOTICE_REF, NoticeReference, optional=True),
                  types.Component(EXPLICIT_TEXT, DisplayText, optional=True))
Exemple #15
0
class NoticeReference(types.Sequence):
    components = (types.Component("organization", DisplayText),
                  types.Component("noticeNumbers", NoticeNumbers))
Exemple #16
0
class AccessDescription(types.Sequence):
    print_labels = False
    print_delimiter = ": "
    components = (types.Component(ACCESS_METHOD, oid.ObjectIdentifier),
                  types.Component(ACCESS_LOCATION, x509_name.GeneralName))
class OtherName(types.Sequence):
    print_delimiter = ", "
    components = ((types.Component("type-id", oid.ObjectIdentifier)),
                  (types.Component("value", types.Any.explicit(0))))
Exemple #18
0
class PolicyInformation(types.Sequence):
    components = (types.Component(POLICY_IDENTIFIER, oid.ObjectIdentifier),
                  types.Component(POLICY_QUALIFIERS,
                                  PolicyQualifiers,
                                  optional=True))
class Validity(types.Sequence):
    components = (
        (types.Component("notBefore", Time)),
        (types.Component("notAfter", Time))
        )
Exemple #20
0
class BasicConstraints(types.Sequence):
    print_delimiter = ", "
    components = ((types.Component("cA", types.Boolean, default=False)),
                  (types.Component("pathLenConstraint",
                                   types.Integer,
                                   optional=True)))
class Certificate(types.Sequence):
    components = ((types.Component("tbsCertificate", TBSCertificate)),
                  (types.Component("signatureAlgorithm", types.Any)),
                  (types.Component("signatureValue", types.BitString)))