diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptography/x509.py | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/cryptography/x509.py b/src/cryptography/x509.py index 0ddff728..c8380b1a 100644 --- a/src/cryptography/x509.py +++ b/src/cryptography/x509.py @@ -314,6 +314,8 @@ class Extension(object): class ExtendedKeyUsage(object): + oid = OID_EXTENDED_KEY_USAGE + def __init__(self, usages): if not all(isinstance(x, ObjectIdentifier) for x in usages): raise TypeError( @@ -342,10 +344,12 @@ class ExtendedKeyUsage(object): class OCSPNoCheck(object): - pass + oid = OID_OCSP_NO_CHECK class BasicConstraints(object): + oid = OID_BASIC_CONSTRAINTS + def __init__(self, ca, path_length): if not isinstance(ca, bool): raise TypeError("ca must be a boolean value") @@ -382,6 +386,8 @@ class BasicConstraints(object): class KeyUsage(object): + oid = OID_KEY_USAGE + def __init__(self, digital_signature, content_commitment, key_encipherment, data_encipherment, key_agreement, key_cert_sign, crl_sign, encipher_only, decipher_only): @@ -465,6 +471,8 @@ class KeyUsage(object): class AuthorityInformationAccess(object): + oid = OID_AUTHORITY_INFORMATION_ACCESS + def __init__(self, descriptions): if not all(isinstance(x, AccessDescription) for x in descriptions): raise TypeError( @@ -529,6 +537,8 @@ class AccessDescription(object): class CertificatePolicies(object): + oid = OID_CERTIFICATE_POLICIES + def __init__(self, policies): if not all(isinstance(x, PolicyInformation) for x in policies): raise TypeError( @@ -666,6 +676,8 @@ class NoticeReference(object): class SubjectKeyIdentifier(object): + oid = OID_SUBJECT_KEY_IDENTIFIER + def __init__(self, digest): self._digest = digest @@ -687,6 +699,8 @@ class SubjectKeyIdentifier(object): class NameConstraints(object): + oid = OID_NAME_CONSTRAINTS + def __init__(self, permitted_subtrees, excluded_subtrees): if permitted_subtrees is not None: if not all( @@ -751,6 +765,8 @@ class NameConstraints(object): class CRLDistributionPoints(object): + oid = OID_CRL_DISTRIBUTION_POINTS + def __init__(self, distribution_points): if not all( isinstance(x, DistributionPoint) for x in distribution_points @@ -871,6 +887,8 @@ class ReasonFlags(Enum): class InhibitAnyPolicy(object): + oid = OID_INHIBIT_ANY_POLICY + def __init__(self, skip_certs): if not isinstance(skip_certs, six.integer_types): raise TypeError("skip_certs must be an integer") @@ -1161,6 +1179,8 @@ class GeneralNames(object): class SubjectAlternativeName(object): + oid = OID_SUBJECT_ALTERNATIVE_NAME + def __init__(self, general_names): self._general_names = GeneralNames(general_names) @@ -1187,6 +1207,8 @@ class SubjectAlternativeName(object): class IssuerAlternativeName(object): + oid = OID_ISSUER_ALTERNATIVE_NAME + def __init__(self, general_names): self._general_names = GeneralNames(general_names) @@ -1213,6 +1235,8 @@ class IssuerAlternativeName(object): class AuthorityKeyIdentifier(object): + oid = OID_AUTHORITY_KEY_IDENTIFIER + def __init__(self, key_identifier, authority_cert_issuer, authority_cert_serial_number): if authority_cert_issuer or authority_cert_serial_number: |