diff --git a/docs/TUTORIAL.md b/docs/TUTORIAL.md index 9d217eeb62..b270911577 100644 --- a/docs/TUTORIAL.md +++ b/docs/TUTORIAL.md @@ -99,10 +99,9 @@ text without prepended symbols is the output of a command. >>> generate_and_write_rsa_keypair("root_key", bits=2048, password="password") # If the key length is unspecified, it defaults to 3072 bits. A length of less -# than 2048 bits raises an exception. A password may be supplied as an -# argument, otherwise a user prompt is presented. If an empty password -# is entered, the private key is saved unencrypted. ->>> generate_and_write_rsa_keypair("root_key2") +# than 2048 bits raises an exception. A password may also be supplied on the +# prompt. If an empty password is entered, the private key is saved unencrypted. +>>> generate_and_write_rsa_keypair("root_key2", prompt=True) Enter a password for the RSA key (/path/to/root_key2): Confirm: ``` @@ -117,7 +116,7 @@ If a filepath is not given, the KEYID of the generated key is used as the filename. The key files are written to the current working directory. ```python # Continuing from the previous section . . . ->>> generate_and_write_rsa_keypair() +>>> generate_and_write_rsa_keypair(prompt=True) Enter a password for the encrypted RSA key (/path/to/b5b8de8aeda674bce948fbe82cab07e309d6775fc0ec299199d16746dc2bd54c): Confirm: ``` @@ -152,7 +151,7 @@ generated from the encrypted PEM string: Bad decrypt. Incorrect password? # supplied, otherwise a prompt is presented. The private key is saved # encrypted if a non-empty password is given, and unencrypted if the password # is empty. ->>> generate_and_write_ed25519_keypair('ed25519_key') +>>> generate_and_write_ed25519_keypair('ed25519_key', prompt=True) Enter a password for the Ed25519 key (/path/to/ed25519_key): Confirm: diff --git a/tests/test_tutorial.py b/tests/test_tutorial.py index 83ee56404a..8401c5c80d 100755 --- a/tests/test_tutorial.py +++ b/tests/test_tutorial.py @@ -78,7 +78,7 @@ def test_tutorial(self): generate_and_write_rsa_keypair('root_key', bits=2048, password='password') # Skipping user entry of password - ## generate_and_write_rsa_keypair('root_key2') + ## generate_and_write_rsa_keypair('root_key2', prompt=True) generate_and_write_rsa_keypair('root_key2', password='password') # Tutorial tells users to expect these files to exist: @@ -109,7 +109,7 @@ def test_tutorial(self): # ----- Tutorial Section: Create and Import Ed25519 Keys # Skipping user entry of password - ## generate_and_write_ed25519_keypair('ed25519_key') + ## generate_and_write_ed25519_keypair('ed25519_key', prompt=True) generate_and_write_ed25519_keypair('ed25519_key', password='password') public_ed25519_key = import_ed25519_publickey_from_file('ed25519_key.pub') diff --git a/tuf/README-developer-tools.md b/tuf/README-developer-tools.md index 3697411390..f4151f7010 100644 --- a/tuf/README-developer-tools.md +++ b/tuf/README-developer-tools.md @@ -53,7 +53,7 @@ is the private key. ``` >>> from tuf.developer_tool import * ->>> generate_and_write_rsa_keypair("path/to/key") +>>> generate_and_write_rsa_keypair("path/to/key", prompt=True) Enter a password for the RSA key: Confirm: >>>