Python cryptography.x509 模块,CertificateIssuer() 实例源码

我们从Python开源项目中,提取了以下14个代码示例,用于说明如何使用cryptography.x509.CertificateIssuer()

项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def _decode_cert_issuer(backend, ext):
    """
    This handler decodes the CertificateIssuer entry extension directly
    from the X509_EXTENSION object. This is necessary because this entry
    extension is not directly supported by OpenSSL 0.9.8.
    """

    data_ptr_ptr = backend._ffi.new("const unsigned char **")
    value = backend._lib.X509_EXTENSION_get_data(ext)
    data_ptr_ptr[0] = value.data
    gns = backend._lib.d2i_GENERAL_NAMES(
        backend._ffi.NULL, data_ptr_ptr, value.length
    )

    # Check the result of d2i_GENERAL_NAMES() is valid. Usually this is covered
    # in _X509ExtensionParser but since we are responsible for decoding this
    # entry extension ourselves, we have to this here.
    if gns == backend._ffi.NULL:
        backend._consume_errors()
        raise ValueError(
            "The {0} extension is corrupted and can't be parsed".format(
                CRLEntryExtensionOID.CERTIFICATE_ISSUER))

    gns = backend._ffi.gc(gns, backend._lib.GENERAL_NAMES_free)
    return x509.CertificateIssuer(_decode_general_names(backend, gns))
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def _decode_cert_issuer(backend, ext):
    """
    This handler decodes the CertificateIssuer entry extension directly
    from the X509_EXTENSION object. This is necessary because this entry
    extension is not directly supported by OpenSSL 0.9.8.
    """

    data_ptr_ptr = backend._ffi.new("const unsigned char **")
    value = backend._lib.X509_EXTENSION_get_data(ext)
    data_ptr_ptr[0] = value.data
    gns = backend._lib.d2i_GENERAL_NAMES(
        backend._ffi.NULL, data_ptr_ptr, value.length
    )

    # Check the result of d2i_GENERAL_NAMES() is valid. Usually this is covered
    # in _X509ExtensionParser but since we are responsible for decoding this
    # entry extension ourselves, we have to this here.
    if gns == backend._ffi.NULL:
        backend._consume_errors()
        raise ValueError(
            "The {0} extension is corrupted and can't be parsed".format(
                CRLEntryExtensionOID.CERTIFICATE_ISSUER))

    gns = backend._ffi.gc(gns, backend._lib.GENERAL_NAMES_free)
    return x509.CertificateIssuer(_decode_general_names(backend, gns))
项目:Intranet-Penetration    作者:yuxiaokui    | 项目源码 | 文件源码
def _decode_cert_issuer(backend, ext):
    """
    This handler decodes the CertificateIssuer entry extension directly
    from the X509_EXTENSION object. This is necessary because this entry
    extension is not directly supported by OpenSSL 0.9.8.
    """

    data_ptr_ptr = backend._ffi.new("const unsigned char **")
    value = backend._lib.X509_EXTENSION_get_data(ext)
    data_ptr_ptr[0] = value.data
    gns = backend._lib.d2i_GENERAL_NAMES(
        backend._ffi.NULL, data_ptr_ptr, value.length
    )

    # Check the result of d2i_GENERAL_NAMES() is valid. Usually this is covered
    # in _X509ExtensionParser but since we are responsible for decoding this
    # entry extension ourselves, we have to this here.
    if gns == backend._ffi.NULL:
        backend._consume_errors()
        raise ValueError(
            "The {0} extension is corrupted and can't be parsed".format(
                CRLEntryExtensionOID.CERTIFICATE_ISSUER))

    gns = backend._ffi.gc(gns, backend._lib.GENERAL_NAMES_free)
    return x509.CertificateIssuer(_decode_general_names(backend, gns))
项目:Intranet-Penetration    作者:yuxiaokui    | 项目源码 | 文件源码
def _decode_cert_issuer(backend, ext):
    """
    This handler decodes the CertificateIssuer entry extension directly
    from the X509_EXTENSION object. This is necessary because this entry
    extension is not directly supported by OpenSSL 0.9.8.
    """

    data_ptr_ptr = backend._ffi.new("const unsigned char **")
    value = backend._lib.X509_EXTENSION_get_data(ext)
    data_ptr_ptr[0] = value.data
    gns = backend._lib.d2i_GENERAL_NAMES(
        backend._ffi.NULL, data_ptr_ptr, value.length
    )

    # Check the result of d2i_GENERAL_NAMES() is valid. Usually this is covered
    # in _X509ExtensionParser but since we are responsible for decoding this
    # entry extension ourselves, we have to this here.
    if gns == backend._ffi.NULL:
        backend._consume_errors()
        raise ValueError(
            "The {0} extension is corrupted and can't be parsed".format(
                CRLEntryExtensionOID.CERTIFICATE_ISSUER))

    gns = backend._ffi.gc(gns, backend._lib.GENERAL_NAMES_free)
    return x509.CertificateIssuer(_decode_general_names(backend, gns))
项目:MKFQ    作者:maojingios    | 项目源码 | 文件源码
def _decode_cert_issuer(backend, ext):
    """
    This handler decodes the CertificateIssuer entry extension directly
    from the X509_EXTENSION object. This is necessary because this entry
    extension is not directly supported by OpenSSL 0.9.8.
    """

    data_ptr_ptr = backend._ffi.new("const unsigned char **")
    value = backend._lib.X509_EXTENSION_get_data(ext)
    data_ptr_ptr[0] = value.data
    gns = backend._lib.d2i_GENERAL_NAMES(
        backend._ffi.NULL, data_ptr_ptr, value.length
    )

    # Check the result of d2i_GENERAL_NAMES() is valid. Usually this is covered
    # in _X509ExtensionParser but since we are responsible for decoding this
    # entry extension ourselves, we have to this here.
    if gns == backend._ffi.NULL:
        backend._consume_errors()
        raise ValueError(
            "The {0} extension is corrupted and can't be parsed".format(
                CRLEntryExtensionOID.CERTIFICATE_ISSUER))

    gns = backend._ffi.gc(gns, backend._lib.GENERAL_NAMES_free)
    return x509.CertificateIssuer(_decode_general_names(backend, gns))
项目:MKFQ    作者:maojingios    | 项目源码 | 文件源码
def _decode_cert_issuer(backend, ext):
    """
    This handler decodes the CertificateIssuer entry extension directly
    from the X509_EXTENSION object. This is necessary because this entry
    extension is not directly supported by OpenSSL 0.9.8.
    """

    data_ptr_ptr = backend._ffi.new("const unsigned char **")
    value = backend._lib.X509_EXTENSION_get_data(ext)
    data_ptr_ptr[0] = value.data
    gns = backend._lib.d2i_GENERAL_NAMES(
        backend._ffi.NULL, data_ptr_ptr, value.length
    )

    # Check the result of d2i_GENERAL_NAMES() is valid. Usually this is covered
    # in _X509ExtensionParser but since we are responsible for decoding this
    # entry extension ourselves, we have to this here.
    if gns == backend._ffi.NULL:
        backend._consume_errors()
        raise ValueError(
            "The {0} extension is corrupted and can't be parsed".format(
                CRLEntryExtensionOID.CERTIFICATE_ISSUER))

    gns = backend._ffi.gc(gns, backend._lib.GENERAL_NAMES_free)
    return x509.CertificateIssuer(_decode_general_names(backend, gns))
项目:xxNet    作者:drzorm    | 项目源码 | 文件源码
def _decode_cert_issuer(backend, ext):
    """
    This handler decodes the CertificateIssuer entry extension directly
    from the X509_EXTENSION object. This is necessary because this entry
    extension is not directly supported by OpenSSL 0.9.8.
    """

    data_ptr_ptr = backend._ffi.new("const unsigned char **")
    value = backend._lib.X509_EXTENSION_get_data(ext)
    data_ptr_ptr[0] = value.data
    gns = backend._lib.d2i_GENERAL_NAMES(
        backend._ffi.NULL, data_ptr_ptr, value.length
    )

    # Check the result of d2i_GENERAL_NAMES() is valid. Usually this is covered
    # in _X509ExtensionParser but since we are responsible for decoding this
    # entry extension ourselves, we have to this here.
    if gns == backend._ffi.NULL:
        backend._consume_errors()
        raise ValueError(
            "The {0} extension is corrupted and can't be parsed".format(
                CRLEntryExtensionOID.CERTIFICATE_ISSUER))

    gns = backend._ffi.gc(gns, backend._lib.GENERAL_NAMES_free)
    return x509.CertificateIssuer(_decode_general_names(backend, gns))
项目:xxNet    作者:drzorm    | 项目源码 | 文件源码
def _decode_cert_issuer(backend, ext):
    """
    This handler decodes the CertificateIssuer entry extension directly
    from the X509_EXTENSION object. This is necessary because this entry
    extension is not directly supported by OpenSSL 0.9.8.
    """

    data_ptr_ptr = backend._ffi.new("const unsigned char **")
    value = backend._lib.X509_EXTENSION_get_data(ext)
    data_ptr_ptr[0] = value.data
    gns = backend._lib.d2i_GENERAL_NAMES(
        backend._ffi.NULL, data_ptr_ptr, value.length
    )

    # Check the result of d2i_GENERAL_NAMES() is valid. Usually this is covered
    # in _X509ExtensionParser but since we are responsible for decoding this
    # entry extension ourselves, we have to this here.
    if gns == backend._ffi.NULL:
        backend._consume_errors()
        raise ValueError(
            "The {0} extension is corrupted and can't be parsed".format(
                CRLEntryExtensionOID.CERTIFICATE_ISSUER))

    gns = backend._ffi.gc(gns, backend._lib.GENERAL_NAMES_free)
    return x509.CertificateIssuer(_decode_general_names(backend, gns))
项目:slack_scholar    作者:xLeitix    | 项目源码 | 文件源码
def _decode_cert_issuer(backend, ext):
    """
    This handler decodes the CertificateIssuer entry extension directly
    from the X509_EXTENSION object. This is necessary because this entry
    extension is not directly supported by OpenSSL 0.9.8.
    """

    data_ptr_ptr = backend._ffi.new("const unsigned char **")
    value = backend._lib.X509_EXTENSION_get_data(ext)
    data_ptr_ptr[0] = value.data
    gns = backend._lib.d2i_GENERAL_NAMES(
        backend._ffi.NULL, data_ptr_ptr, value.length
    )

    # Check the result of d2i_GENERAL_NAMES() is valid. Usually this is covered
    # in _X509ExtensionParser but since we are responsible for decoding this
    # entry extension ourselves, we have to this here.
    if gns == backend._ffi.NULL:
        backend._consume_errors()
        raise ValueError(
            "The {0} extension is corrupted and can't be parsed".format(
                CRLEntryExtensionOID.CERTIFICATE_ISSUER))

    gns = backend._ffi.gc(gns, backend._lib.GENERAL_NAMES_free)
    return x509.CertificateIssuer(_decode_general_names(backend, gns))
项目:Docker-XX-Net    作者:kuanghy    | 项目源码 | 文件源码
def _decode_cert_issuer(backend, ext):
    """
    This handler decodes the CertificateIssuer entry extension directly
    from the X509_EXTENSION object. This is necessary because this entry
    extension is not directly supported by OpenSSL 0.9.8.
    """

    data_ptr_ptr = backend._ffi.new("const unsigned char **")
    value = backend._lib.X509_EXTENSION_get_data(ext)
    data_ptr_ptr[0] = value.data
    gns = backend._lib.d2i_GENERAL_NAMES(
        backend._ffi.NULL, data_ptr_ptr, value.length
    )

    # Check the result of d2i_GENERAL_NAMES() is valid. Usually this is covered
    # in _X509ExtensionParser but since we are responsible for decoding this
    # entry extension ourselves, we have to this here.
    if gns == backend._ffi.NULL:
        backend._consume_errors()
        raise ValueError(
            "The {0} extension is corrupted and can't be parsed".format(
                CRLEntryExtensionOID.CERTIFICATE_ISSUER))

    gns = backend._ffi.gc(gns, backend._lib.GENERAL_NAMES_free)
    return x509.CertificateIssuer(_decode_general_names(backend, gns))
项目:PyQYT    作者:collinsctk    | 项目源码 | 文件源码
def _decode_cert_issuer(backend, ext):
    """
    This handler decodes the CertificateIssuer entry extension directly
    from the X509_EXTENSION object. This is necessary because this entry
    extension is not directly supported by OpenSSL 0.9.8.
    """

    data_ptr_ptr = backend._ffi.new("const unsigned char **")
    value = backend._lib.X509_EXTENSION_get_data(ext)
    data_ptr_ptr[0] = value.data
    gns = backend._lib.d2i_GENERAL_NAMES(
        backend._ffi.NULL, data_ptr_ptr, value.length
    )

    # Check the result of d2i_GENERAL_NAMES() is valid. Usually this is covered
    # in _X509ExtensionParser but since we are responsible for decoding this
    # entry extension ourselves, we have to this here.
    if gns == backend._ffi.NULL:
        backend._consume_errors()
        raise ValueError(
            "The {0} extension is corrupted and can't be parsed".format(
                CRLEntryExtensionOID.CERTIFICATE_ISSUER))

    gns = backend._ffi.gc(gns, backend._lib.GENERAL_NAMES_free)
    return x509.CertificateIssuer(_decode_general_names(backend, gns))
项目:aws-cfn-plex    作者:lordmuffin    | 项目源码 | 文件源码
def _decode_cert_issuer(backend, gns):
    gns = backend._ffi.cast("GENERAL_NAMES *", gns)
    gns = backend._ffi.gc(gns, backend._lib.GENERAL_NAMES_free)
    general_names = _decode_general_names(backend, gns)
    return x509.CertificateIssuer(general_names)
项目:RemoteTree    作者:deNULL    | 项目源码 | 文件源码
def _decode_cert_issuer(backend, gns):
    gns = backend._ffi.cast("GENERAL_NAMES *", gns)
    gns = backend._ffi.gc(gns, backend._lib.GENERAL_NAMES_free)
    general_names = _decode_general_names(backend, gns)
    return x509.CertificateIssuer(general_names)
项目:quickstart-git2s3    作者:aws-quickstart    | 项目源码 | 文件源码
def _decode_cert_issuer(backend, gns):
    gns = backend._ffi.cast("GENERAL_NAMES *", gns)
    gns = backend._ffi.gc(gns, backend._lib.GENERAL_NAMES_free)
    general_names = _decode_general_names(backend, gns)
    return x509.CertificateIssuer(general_names)