當前位置: 首頁>>代碼示例>>Python>>正文


Python x509.InhibitAnyPolicy方法代碼示例

本文整理匯總了Python中cryptography.x509.InhibitAnyPolicy方法的典型用法代碼示例。如果您正苦於以下問題:Python x509.InhibitAnyPolicy方法的具體用法?Python x509.InhibitAnyPolicy怎麽用?Python x509.InhibitAnyPolicy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在cryptography.x509的用法示例。


在下文中一共展示了x509.InhibitAnyPolicy方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _decode_inhibit_any_policy

# 需要導入模塊: from cryptography import x509 [as 別名]
# 或者: from cryptography.x509 import InhibitAnyPolicy [as 別名]
def _decode_inhibit_any_policy(backend, asn1_int):
    asn1_int = backend._ffi.cast("ASN1_INTEGER *", asn1_int)
    asn1_int = backend._ffi.gc(asn1_int, backend._lib.ASN1_INTEGER_free)
    skip_certs = _asn1_integer_to_int(backend, asn1_int)
    return x509.InhibitAnyPolicy(skip_certs)


#    CRLReason ::= ENUMERATED {
#        unspecified             (0),
#        keyCompromise           (1),
#        cACompromise            (2),
#        affiliationChanged      (3),
#        superseded              (4),
#        cessationOfOperation    (5),
#        certificateHold         (6),
#             -- value 7 is not used
#        removeFromCRL           (8),
#        privilegeWithdrawn      (9),
#        aACompromise           (10) } 
開發者ID:proxysh,項目名稱:Safejumper-for-Desktop,代碼行數:21,代碼來源:decode_asn1.py

示例2: _decode_inhibit_any_policy

# 需要導入模塊: from cryptography import x509 [as 別名]
# 或者: from cryptography.x509 import InhibitAnyPolicy [as 別名]
def _decode_inhibit_any_policy(backend, asn1_int):
    asn1_int = backend._ffi.cast("ASN1_INTEGER *", asn1_int)
    asn1_int = backend._ffi.gc(asn1_int, backend._lib.ASN1_INTEGER_free)
    skip_certs = backend._asn1_integer_to_int(asn1_int)
    return x509.InhibitAnyPolicy(skip_certs) 
開發者ID:aliyun,項目名稱:oss-ftp,代碼行數:7,代碼來源:x509.py

示例3: _decode_inhibit_any_policy

# 需要導入模塊: from cryptography import x509 [as 別名]
# 或者: from cryptography.x509 import InhibitAnyPolicy [as 別名]
def _decode_inhibit_any_policy(backend, asn1_int):
    asn1_int = backend._ffi.cast("ASN1_INTEGER *", asn1_int)
    asn1_int = backend._ffi.gc(asn1_int, backend._lib.ASN1_INTEGER_free)
    skip_certs = _asn1_integer_to_int(backend, asn1_int)
    return x509.InhibitAnyPolicy(skip_certs) 
開發者ID:tp4a,項目名稱:teleport,代碼行數:7,代碼來源:decode_asn1.py

示例4: extension_type

# 需要導入模塊: from cryptography import x509 [as 別名]
# 或者: from cryptography.x509 import InhibitAnyPolicy [as 別名]
def extension_type(self):
        return x509.InhibitAnyPolicy(skip_certs=self.value) 
開發者ID:mathiasertl,項目名稱:django-ca,代碼行數:4,代碼來源:extensions.py

示例5: test_int

# 需要導入模塊: from cryptography import x509 [as 別名]
# 或者: from cryptography.x509 import InhibitAnyPolicy [as 別名]
def test_int(self):
        ext = InhibitAnyPolicy(0)
        self.assertEqual(ext.value, 0)
        ext = InhibitAnyPolicy(1)
        self.assertEqual(ext.value, 1)

        with self.assertRaisesRegex(ValueError, r'-1: must be a positive int$'):
            InhibitAnyPolicy(-1)
        with self.assertRaisesRegex(ValueError, r'-1: must be a positive int$'):
            InhibitAnyPolicy({'value': -1}) 
開發者ID:mathiasertl,項目名稱:django-ca,代碼行數:12,代碼來源:tests_extensions.py

示例6: test_no_int

# 需要導入模塊: from cryptography import x509 [as 別名]
# 或者: from cryptography.x509 import InhibitAnyPolicy [as 別名]
def test_no_int(self):
        with self.assertRaisesRegex(ValueError, r'^None: must be an int$'):
            InhibitAnyPolicy(None)
        with self.assertRaisesRegex(ValueError, r'^abc: must be an int$'):
            InhibitAnyPolicy({'value': 'abc'})
        with self.assertRaisesRegex(ValueError, r'^Value is of unsupported type str$'):
            InhibitAnyPolicy('abc') 
開發者ID:mathiasertl,項目名稱:django-ca,代碼行數:9,代碼來源:tests_extensions.py

示例7: test_skip_certs

# 需要導入模塊: from cryptography import x509 [as 別名]
# 或者: from cryptography.x509 import InhibitAnyPolicy [as 別名]
def test_skip_certs(self):
        ext = InhibitAnyPolicy(0)
        self.assertEqual(ext.skip_certs, 0)
        ext.skip_certs = 3
        self.assertEqual(ext.skip_certs, 3)

        with self.assertRaisesRegex(ValueError, r'^abc: must be an int$'):
            ext.skip_certs = 'abc'
        self.assertEqual(ext.skip_certs, 3)
        with self.assertRaisesRegex(ValueError, r'-1: must be a positive int$'):
            ext.skip_certs = -1
        self.assertEqual(ext.skip_certs, 3) 
開發者ID:mathiasertl,項目名稱:django-ca,代碼行數:14,代碼來源:tests_extensions.py


注:本文中的cryptography.x509.InhibitAnyPolicy方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。