Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run certtool for encrypted ca.key.pem #6

Open
cryptoBeliever opened this issue Jan 10, 2022 · 0 comments
Open

Unable to run certtool for encrypted ca.key.pem #6

cryptoBeliever opened this issue Jan 10, 2022 · 0 comments

Comments

@cryptoBeliever
Copy link

cryptoBeliever commented Jan 10, 2022

How to Reproduce

  1. create ca.key.pem encrypted with password
echo "0000000000000000000000000000000000000000000000000000000000000000" > private.key.txt
python3 symbol-node-configurator/pemtool.py --input private.key.txt --output ca.key.pem --ask-pass
  1. Try generate certificates
python3 symbol-node-configurator/certtool.py --ca ca.key.pem --working cert --package certificates

Result (Error "Password was not given but private key is encrypted"):

/symbol_node2$ python3 symbol-node-configurator/certtool.py --ca ca.key.pem --working cert --package certificates
      i     | preparing configuration files
Traceback (most recent call last):
  File "symbol-node-configurator/certtool.py", line 223, in <module>
    main()
  File "symbol-node-configurator/certtool.py", line 187, in main
    main_private_key = PrivateKeyStorage(ca_path.parent).load(ca_path.stem)
  File "/home/pmielcar/.local/lib/python3.8/site-packages/symbolchain/core/PrivateKeyStorage.py", line 33, in load
    wrapped_private_key = serialization.load_pem_private_key(infile.read(), password=self.password)
  File "/home/pmielcar/.local/lib/python3.8/site-packages/cryptography/hazmat/primitives/serialization/base.py", line 20, in load_pem_private_key
    return backend.load_pem_private_key(data, password)
  File "/home/pmielcar/.local/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 1217, in load_pem_private_key
    return self._load_key(
  File "/home/pmielcar/.local/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 1438, in _load_key
    raise TypeError(
TypeError: Password was not given but private key is encrypted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant