4
我试图根据示例here为AWS Cloudfront生成已签名的URL。上线UnsupportedAlgorithm:这个后端不支持这个键序列化。 - Python加密load_pem_private_key
private_key = serialization.load_pem_private_key(
key_file.read(),
password=None,
backend=default_backend()
)
我得到的错误UnsupportedAlgorithm: This backend does not support this key serialization.
完整轨迹如下:
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.
在阅读的文档,它说的是,发生异常是因为以下几点:
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.
给定的PEM文件以-----BEGIN RSA PRIVATE KEY-----
开头并以-----END RSA PRIVATE KEY-----
结尾。
我在开发此应用程序时使用google appengine sdk。
我需要帮助了解此错误消息以及如何使其工作。
不错,我正在跟踪这个问题。 –