question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to Add Target Files when following instruction in TUTORIAL.md

See original GitHub issue

I was following the TUTORIAL.md And at the line private_targets_key = import_rsa_privatekey_from_file("keystore/targets_key") after I enter password, it returns an error:

_Traceback (most recent call last): File “/usr/local/lib/python3.6/dist-packages/securesystemslib/pyca_crypto_keys.py”, line 611, in create_rsa_public_and_private_from_pem passphrase, backend=default_backend()) File “/usr/local/lib/python3.6/dist-packages/cryptography/hazmat/primitives/serialization.py”, line 20, in load_pem_private_key return backend.load_pem_private_key(data, password) File “/usr/local/lib/python3.6/dist-packages/cryptography/hazmat/backends/openssl/backend.py”, line 1014, in load_pem_private_key password, File “/usr/local/lib/python3.6/dist-packages/cryptography/hazmat/backends/openssl/backend.py”, line 1233, in _load_key self._handle_key_loading_error() File “/usr/local/lib/python3.6/dist-packages/cryptography/hazmat/backends/openssl/backend.py”, line 1291, in _handle_key_loading_error raise ValueError(“Could not deserialize key data.”) ValueError: Could not deserialize key data.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “/home/thangld_anm/newSIEM/tuf/tuf/repository_lib.py”, line 824, in import_rsa_privatekey_from_file filepath, password) File “/usr/local/lib/python3.6/dist-packages/securesystemslib/interface.py”, line 350, in import_rsa_privatekey_from_file scheme, password) File “/usr/local/lib/python3.6/dist-packages/securesystemslib/keys.py”, line 974, in import_rsakey_from_private_pem pem, password) File “/usr/local/lib/python3.6/dist-packages/securesystemslib/pyca_crypto_keys.py”, line 625, in create_rsa_public_and_private_from_pem ’ cannot be generated from the encrypted PEM string: ’ + str(e)) securesystemslib.exceptions.CryptoError: RSA (public, private) tuple cannot be generated from the encrypted PEM string: Could not deserialize key data.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “/usr/local/lib/python3.6/dist-packages/securesystemslib/pyca_crypto_keys.py”, line 611, in create_rsa_public_and_private_from_pem passphrase, backend=default_backend()) File “/usr/local/lib/python3.6/dist-packages/cryptography/hazmat/primitives/serialization.py”, line 20, in load_pem_private_key return backend.load_pem_private_key(data, password) File “/usr/local/lib/python3.6/dist-packages/cryptography/hazmat/backends/openssl/backend.py”, line 1014, in load_pem_private_key password, File “/usr/local/lib/python3.6/dist-packages/cryptography/hazmat/backends/openssl/backend.py”, line 1233, in _load_key self._handle_key_loading_error() File “/usr/local/lib/python3.6/dist-packages/cryptography/hazmat/backends/openssl/backend.py”, line 1291, in _handle_key_loading_error raise ValueError(“Could not deserialize key data.”) ValueError: Could not deserialize key data.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “<stdin>”, line 1, in <module> File “/home/thangld_anm/newSIEM/tuf/tuf/repository_tool.py”, line 3185, in import_rsa_privatekey_from_file return repo_lib.import_rsa_privatekey_from_file(filepath, password) File “/home/thangld_anm/newSIEM/tuf/tuf/repository_lib.py”, line 831, in import_rsa_privatekey_from_file filepath, password, prompt=True) File “/usr/local/lib/python3.6/dist-packages/securesystemslib/interface.py”, line 350, in import_rsa_privatekey_from_file scheme, password) File “/usr/local/lib/python3.6/dist-packages/securesystemslib/keys.py”, line 974, in import_rsakey_from_private_pem pem, password) File “/usr/local/lib/python3.6/dist-packages/securesystemslib/pyca_crypto_keys.py”, line 625, in create_rsa_public_and_private_from_pem ’ cannot be generated from the encrypted PEM string: ’ + str(e)) securesystemslib.exceptions.CryptoError: RSA (public, private) tuple cannot be generated from the encrypted PEM string: Could not deserialize key data. _ Can you tell me how can I fix this? Thank you.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
awwadcommented, Aug 20, 2018

I’ll take a look and see if I can reproduce this today. 🙂 Thanks for creating an issue.

0reactions
thangld322commented, Aug 22, 2018

The test runs successfully. Look like my code is wrong somewhere. I’ll take a look. Thanks for response. You can close this issue now. 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

tonic/routeguide-tutorial.md at master · hyperium/tonic - GitHub
This tutorial, adapted from grpc-go, provides a basic introduction to working with gRPC and Tonic. ... Create a build.rs file at the root...
Read more >
Python Tutorial - File and Text Processing
Open a file for writing and insert some records >>> f = open('test.txt', ... The following script copies a file into another line-by-line,...
Read more >
Tutorial: Deploying a Hello World application
Go to Installing the AWS SAM CLI, choose the appropriate platform, and then follow the instructions in the section titled Install Docker. Curl...
Read more >
Error message at debugger connection-Setting of the id code ...
Connection failed when debugging the e² studio project, resulting in the following error: Setting of the id code failed. E1_E20_IDCode() Failed
Read more >
Docker - failed to compute cache key: not found - runs fine in ...
Check your .dockerignore file. Possible it ignores needed files for copy command and you get failed to compute cache key error.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found