当前位置: 首页>>代码示例>>Python>>正文


Python general_name.GeneralName方法代码示例

本文整理汇总了Python中cryptography.x509.general_name.GeneralName方法的典型用法代码示例。如果您正苦于以下问题:Python general_name.GeneralName方法的具体用法?Python general_name.GeneralName怎么用?Python general_name.GeneralName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cryptography.x509.general_name的用法示例。


在下文中一共展示了general_name.GeneralName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from cryptography.x509 import general_name [as 别名]
# 或者: from cryptography.x509.general_name import GeneralName [as 别名]
def __init__(self, key_identifier, authority_cert_issuer,
                 authority_cert_serial_number):
        if authority_cert_issuer or authority_cert_serial_number:
            if not authority_cert_issuer or not authority_cert_serial_number:
                raise ValueError(
                    "authority_cert_issuer and authority_cert_serial_number "
                    "must both be present or both None"
                )

            if not all(
                isinstance(x, GeneralName) for x in authority_cert_issuer
            ):
                raise TypeError(
                    "authority_cert_issuer must be a list of GeneralName "
                    "objects"
                )

            if not isinstance(authority_cert_serial_number, six.integer_types):
                raise TypeError(
                    "authority_cert_serial_number must be an integer"
                )

        self._key_identifier = key_identifier
        self._authority_cert_issuer = authority_cert_issuer
        self._authority_cert_serial_number = authority_cert_serial_number 
开发者ID:satwikkansal,项目名称:OneClickDTU,代码行数:27,代码来源:extensions.py

示例2: __init__

# 需要导入模块: from cryptography.x509 import general_name [as 别名]
# 或者: from cryptography.x509.general_name import GeneralName [as 别名]
def __init__(self, key_identifier, authority_cert_issuer,
                 authority_cert_serial_number):
        if (authority_cert_issuer is None) != (
            authority_cert_serial_number is None
        ):
            raise ValueError(
                "authority_cert_issuer and authority_cert_serial_number "
                "must both be present or both None"
            )

        if authority_cert_issuer is not None and not all(
            isinstance(x, GeneralName) for x in authority_cert_issuer
        ):
            raise TypeError(
                "authority_cert_issuer must be a list of GeneralName "
                "objects"
            )

        if authority_cert_serial_number is not None and not isinstance(
            authority_cert_serial_number, six.integer_types
        ):
            raise TypeError(
                "authority_cert_serial_number must be an integer"
            )

        self._key_identifier = key_identifier
        self._authority_cert_issuer = authority_cert_issuer
        self._authority_cert_serial_number = authority_cert_serial_number 
开发者ID:DirceuSilvaLabs,项目名称:noc-orchestrator,代码行数:30,代码来源:extensions.py

示例3: __init__

# 需要导入模块: from cryptography.x509 import general_name [as 别名]
# 或者: from cryptography.x509.general_name import GeneralName [as 别名]
def __init__(self, key_identifier, authority_cert_issuer,
                 authority_cert_serial_number):
        if (authority_cert_issuer is None) != (
            authority_cert_serial_number is None
        ):
            raise ValueError(
                "authority_cert_issuer and authority_cert_serial_number "
                "must both be present or both None"
            )

        if authority_cert_issuer is not None:
            authority_cert_issuer = list(authority_cert_issuer)
            if not all(
                isinstance(x, GeneralName) for x in authority_cert_issuer
            ):
                raise TypeError(
                    "authority_cert_issuer must be a list of GeneralName "
                    "objects"
                )

        if authority_cert_serial_number is not None and not isinstance(
            authority_cert_serial_number, six.integer_types
        ):
            raise TypeError(
                "authority_cert_serial_number must be an integer"
            )

        self._key_identifier = key_identifier
        self._authority_cert_issuer = authority_cert_issuer
        self._authority_cert_serial_number = authority_cert_serial_number 
开发者ID:lordmuffin,项目名称:aws-cfn-plex,代码行数:32,代码来源:extensions.py


注:本文中的cryptography.x509.general_name.GeneralName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。