Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/285.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
UnsupportedAlgorithm:此后端不支持此密钥序列化。-Python加密加载\u pem\u私钥_Python_Google App Engine_Boto3_Pem_Python Cryptography - Fatal编程技术网

UnsupportedAlgorithm:此后端不支持此密钥序列化。-Python加密加载\u pem\u私钥

UnsupportedAlgorithm:此后端不支持此密钥序列化。-Python加密加载\u pem\u私钥,python,google-app-engine,boto3,pem,python-cryptography,Python,Google App Engine,Boto3,Pem,Python Cryptography,我试图根据这个示例为AWS Cloudfront生成签名URL。在线 private_key = serialization.load_pem_private_key( key_file.read(), password=None, backend=default_backend() ) 我得到错误不支持DalGorithm:此后端不支持此密钥序列化。完整跟踪如下: File "command_util.py", line 98, in

我试图根据这个示例为AWS Cloudfront生成签名URL。在线

private_key = serialization.load_pem_private_key(
        key_file.read(),
        password=None,
        backend=default_backend()
    )
我得到错误
不支持DalGorithm:此后端不支持此密钥序列化。
完整跟踪如下:

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文件以
----开始RSA私钥------
开头,以
----结束RSA私钥------
结尾

在开发此应用程序时,我正在使用google appengine sdk


我需要帮助理解此错误消息以及如何执行此操作。

不幸的是,python加密库不能与google appengine(GAE)一起使用,因为此库需要有C扩展,并且您不能在GAE中安装C扩展。您只能使用纯python软件包。

Nice,我正在跟踪这个问题。