當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。