aboutsummaryrefslogtreecommitdiff
path: root/nitrocli/src/pinentry.rs
diff options
context:
space:
mode:
authorRobin Krahl <me@robin-krahl.de>2018-12-11 12:09:43 +0100
committerDaniel Müller <d-e-s-o@users.noreply.github.com>2018-12-11 17:34:18 -0800
commit9c80ad0f2e21bd82d071571db4e8a94a575146e5 (patch)
tree8ffeed3e69a3658a878c994d328b8521314d0896 /nitrocli/src/pinentry.rs
parent324016494904ce3d53bbfb63a76f67e220e0685c (diff)
downloadnitrocli-9c80ad0f2e21bd82d071571db4e8a94a575146e5.tar.gz
nitrocli-9c80ad0f2e21bd82d071571db4e8a94a575146e5.tar.bz2
Add doc comment to pinentry::inquire_passphrase
Diffstat (limited to 'nitrocli/src/pinentry.rs')
-rw-r--r--nitrocli/src/pinentry.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/nitrocli/src/pinentry.rs b/nitrocli/src/pinentry.rs
index 0553b8e..7bf1db9 100644
--- a/nitrocli/src/pinentry.rs
+++ b/nitrocli/src/pinentry.rs
@@ -83,6 +83,10 @@ fn parse_pinentry_passphrase(response: Vec<u8>) -> Result<Vec<u8>, Error> {
}
+/// Inquire a PIN of the given type from the user.
+///
+/// This function inquires a PIN of the given type from the user or returns the cached passphrase,
+/// if available. If an error message is set, it is displayed in the passphrase dialog.
pub fn inquire_passphrase(pin_type: PinType, error_msg: Option<&str>) -> Result<Vec<u8>, Error> {
let cache_id = pin_type.cache_id();
let error_msg = error_msg.map(|msg| msg.replace(" ", "+")).unwrap_or(String::from("+"));