Merge "Replace pyOpenSSL by cryptography"
This commit is contained in:
commit
3d11d9ffac
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
from cryptography.hazmat.backends import default_backend
|
from cryptography.hazmat.backends import default_backend
|
||||||
from cryptography.hazmat.primitives import serialization
|
from cryptography.hazmat.primitives import serialization
|
||||||
from OpenSSL import crypto
|
from cryptography import x509
|
||||||
from oslo_serialization import base64
|
from oslo_serialization import base64
|
||||||
|
|
||||||
from barbican import i18n as u # noqa
|
from barbican import i18n as u # noqa
|
||||||
@ -188,12 +188,12 @@ def _convert_public_der_to_pem(der):
|
|||||||
|
|
||||||
|
|
||||||
def _convert_certificate_pem_to_der(pem):
|
def _convert_certificate_pem_to_der(pem):
|
||||||
cert = crypto.load_certificate(crypto.FILETYPE_PEM, pem)
|
cert = x509.load_pem_x509_certificate(pem)
|
||||||
der = crypto.dump_certificate(crypto.FILETYPE_ASN1, cert)
|
der = cert.public_bytes(serialization.Encoding.DER)
|
||||||
return der
|
return der
|
||||||
|
|
||||||
|
|
||||||
def _convert_certificate_der_to_pem(der):
|
def _convert_certificate_der_to_pem(der):
|
||||||
cert = crypto.load_certificate(crypto.FILETYPE_ASN1, der)
|
cert = x509.load_der_x509_certificate(der)
|
||||||
pem = crypto.dump_certificate(crypto.FILETYPE_PEM, cert)
|
pem = cert.public_bytes(serialization.Encoding.PEM)
|
||||||
return pem
|
return pem
|
||||||
|
@ -20,7 +20,6 @@ Paste>=2.0.2 # MIT
|
|||||||
PasteDeploy>=1.5.0 # MIT
|
PasteDeploy>=1.5.0 # MIT
|
||||||
pbr!=2.1.0,>=2.0.0 # Apache-2.0
|
pbr!=2.1.0,>=2.0.0 # Apache-2.0
|
||||||
pecan!=1.0.2,!=1.0.3,!=1.0.4,!=1.2,>=1.0.0 # BSD
|
pecan!=1.0.2,!=1.0.3,!=1.0.4,!=1.2,>=1.0.0 # BSD
|
||||||
pyOpenSSL>=17.1.0 # Apache-2.0
|
|
||||||
ldap3>=1.0.2 # LGPLv3
|
ldap3>=1.0.2 # LGPLv3
|
||||||
keystonemiddleware>=9.5.0 # Apache-2.0
|
keystonemiddleware>=9.5.0 # Apache-2.0
|
||||||
SQLAlchemy>=1.4.0 # MIT
|
SQLAlchemy>=1.4.0 # MIT
|
||||||
|
Loading…
Reference in New Issue
Block a user