UnsupportedAlgorithm: This backend does not support this key serialization. - Python cryptography load_pem_private_key
<p>I am trying to generate signed urls for AWS Cloudfront based on the example <a href="http://boto3.readthedocs.io/en/latest/reference/services/cloudfront.html#examples" rel="nofollow">here</a>. On the line </p>

<pre><code>private_key = serialization.load_pem_private_key(
        key_file.read(),
        password=None,
        backend=default_backend()
    )
</code></pre>

<p>I get the error <code>UnsupportedAlgorithm: This backend does not support this key serialization.</code> The full trace is as below:</p>

<pre><code>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.
</code></pre>

<p>On reading the docs it says that the exception occurs because of the following:</p>

<pre><code>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.
</code></pre>

<p>The PEM file given starts with <code>-----BEGIN RSA PRIVATE KEY-----</code> and ends with <code>-----END RSA PRIVATE KEY-----</code> . </p>

<p>I am using google appengine sdk while developing this application.</p>

<p>I need help understanding this error message and how to make this work.</p>

<p>Unfortunately the python cryptography library cannot be used with google appengine(GAE) as this library needs to have C extensions and you cannot install C extensions in GAE. You can only use pure python packages.</p>

python google-app-engine boto3 pem python-cryptography