summaryrefslogtreecommitdiffstats
path: root/openpgp/examples/sign.rs
diff options
context:
space:
mode:
Diffstat (limited to 'openpgp/examples/sign.rs')
-rw-r--r--openpgp/examples/sign.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/openpgp/examples/sign.rs b/openpgp/examples/sign.rs
index 02feea96..585242c4 100644
--- a/openpgp/examples/sign.rs
+++ b/openpgp/examples/sign.rs
@@ -34,9 +34,10 @@ fn main() -> openpgp::Result<()> {
keys.push({
let mut key = key.clone();
if key.secret().is_encrypted() {
- let password = rpassword::read_password_from_tty(
- Some(&format!("Please enter password to decrypt \
- {}/{}: ",tsk, key)))?;
+ let password = rpassword::prompt_password(format!(
+ "Please enter password to decrypt {}/{}: ",
+ tsk, key
+ ))?;
let algo = key.pk_algo();
key.secret_mut()
.decrypt_in_place(algo, &password.into())