J'essaie de générer des URLs signées pour AWS Cloudfront sur la base de l'exemple here. Sur la ligneUnsupportedAlgorithm: ce backend ne prend pas en charge cette sérialisation de clé. - Cryptographie Python load_pem_private_key
private_key = serialization.load_pem_private_key(
key_file.read(),
password=None,
backend=default_backend()
)
Je reçois l'erreur UnsupportedAlgorithm: This backend does not support this key serialization.
La trace complète est comme ci-dessous:
File "command_util.py", line 98, in rsa_signer
backend=default_backend()
File "runtime/cryptography/hazmat/primitives/serialization.py", line 20, in load_pem_private_key
return backend.load_pem_private_key(data, password)
File "runtime/cryptography/hazmat/backends/multibackend.py", line 286, in load_pem_private_key
_Reasons.UNSUPPORTED_SERIALIZATION
UnsupportedAlgorithm: This backend does not support this key serialization.
A la lecture de la documentation, il dit que l'exception se produit en raison des éléments suivants:
cryptography.exceptions.UnsupportedAlgorithm – the serialized key is of a type that is not supported by the backend or if
the key is encrypted with a symmetric cipher that is not supported by the backend.
Le fichier PEM donné commence par -----BEGIN RSA PRIVATE KEY-----
et se termine par . J'utilise google appengine sdk pendant le développement de cette application.
J'ai besoin d'aide pour comprendre ce message d'erreur et comment le faire fonctionner.
Bien, je suivais la question. –