コード例 #1
0
 def from_public_bytes(cls, data):
     from cryptography.hazmat.backends.openssl.backend import backend
     if not backend.x25519_supported():
         raise UnsupportedAlgorithm(
             "X25519 is not supported by this version of OpenSSL.",
             _Reasons.UNSUPPORTED_EXCHANGE_ALGORITHM)
     return backend.x25519_load_public_bytes(data)
コード例 #2
0
ファイル: x25519.py プロジェクト: DamirAinullin/PTVS
 def from_public_bytes(cls, data):
     from cryptography.hazmat.backends.openssl.backend import backend
     if not backend.x25519_supported():
         raise UnsupportedAlgorithm(
             "X25519 is not supported by this version of OpenSSL.",
             _Reasons.UNSUPPORTED_EXCHANGE_ALGORITHM
         )
     return backend.x25519_load_public_bytes(data)