当前位置: 首页>>代码示例>>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;未经允许,请勿转载。