Python源码示例:cryptography.x509.CertificateRevocationList()
示例1
def from_cryptography(cls, crypto_crl):
"""
Construct based on a ``cryptography`` *crypto_crl*.
:param crypto_crl: A ``cryptography`` certificate revocation list
:type crypto_crl: ``cryptography.x509.CertificateRevocationList``
:rtype: CRL
.. versionadded:: 17.1.0
"""
if not isinstance(crypto_crl, x509.CertificateRevocationList):
raise TypeError("Must be a certificate revocation list")
crl = cls()
crl._crl = crypto_crl._x509_crl
return crl
示例2
def from_cryptography(cls, crypto_crl):
"""
Construct based on a ``cryptography`` *crypto_crl*.
:param crypto_crl: A ``cryptography`` certificate revocation list
:type crypto_crl: ``cryptography.x509.CertificateRevocationList``
:rtype: CRL
.. versionadded:: 17.1.0
"""
if not isinstance(crypto_crl, x509.CertificateRevocationList):
raise TypeError("Must be a certificate revocation list")
crl = cls()
crl._crl = crypto_crl._x509_crl
return crl
示例3
def __eq__(self, other):
if not isinstance(other, x509.CertificateRevocationList):
return NotImplemented
res = self._backend._lib.X509_CRL_cmp(self._x509_crl, other._x509_crl)
return res == 0
示例4
def __eq__(self, other):
if not isinstance(other, x509.CertificateRevocationList):
return NotImplemented
res = self._backend._lib.X509_CRL_cmp(self._x509_crl, other._x509_crl)
return res == 0
示例5
def __eq__(self, other):
if not isinstance(other, x509.CertificateRevocationList):
return NotImplemented
res = self._backend._lib.X509_CRL_cmp(self._x509_crl, other._x509_crl)
return res == 0
示例6
def __eq__(self, other):
if not isinstance(other, x509.CertificateRevocationList):
return NotImplemented
res = self._backend._lib.X509_CRL_cmp(self._x509_crl, other._x509_crl)
return res == 0
示例7
def __eq__(self, other):
if not isinstance(other, x509.CertificateRevocationList):
return NotImplemented
res = self._backend._lib.X509_CRL_cmp(self._x509_crl, other._x509_crl)
return res == 0
示例8
def to_cryptography(self):
"""
Export as a ``cryptography`` CRL.
:rtype: ``cryptography.x509.CertificateRevocationList``
.. versionadded:: 17.1.0
"""
from cryptography.hazmat.backends.openssl.x509 import (
_CertificateRevocationList
)
backend = _get_backend()
return _CertificateRevocationList(backend, self._crl)
示例9
def __eq__(self, other):
if not isinstance(other, x509.CertificateRevocationList):
return NotImplemented
res = self._backend._lib.X509_CRL_cmp(self._x509_crl, other._x509_crl)
return res == 0
示例10
def __eq__(self, other):
if not isinstance(other, x509.CertificateRevocationList):
return NotImplemented
res = self._backend._lib.X509_CRL_cmp(self._x509_crl, other._x509_crl)
return res == 0
示例11
def to_cryptography(self):
"""
Export as a ``cryptography`` CRL.
:rtype: ``cryptography.x509.CertificateRevocationList``
.. versionadded:: 17.1.0
"""
from cryptography.hazmat.backends.openssl.x509 import (
_CertificateRevocationList
)
backend = _get_backend()
return _CertificateRevocationList(backend, self._crl)
示例12
def test_convert_to_cryptography_key(self):
crl = load_crl(FILETYPE_PEM, crlData)
crypto_crl = crl.to_cryptography()
assert isinstance(crypto_crl, x509.CertificateRevocationList)
示例13
def __eq__(self, other):
if not isinstance(other, x509.CertificateRevocationList):
return NotImplemented
res = self._backend._lib.X509_CRL_cmp(self._x509_crl, other._x509_crl)
return res == 0
示例14
def __eq__(self, other):
if not isinstance(other, x509.CertificateRevocationList):
return NotImplemented
res = self._backend._lib.X509_CRL_cmp(self._x509_crl, other._x509_crl)
return res == 0