[][src]Struct pinentry::PassphraseInput

pub struct PassphraseInput<'a> { /* fields omitted */ }

A dialog for requesting a passphrase from the user.

Implementations

impl<'a> PassphraseInput<'a>[src]

pub fn with_default_binary() -> Option<Self>[src]

Creates a new PassphraseInput using the binary named pinentry.

Returns None if pinentry cannot be found in PATH.

pub fn with_binary<T: AsRef<OsStr>>(binary_name: T) -> Option<Self>[src]

Creates a new PassphraseInput using the given path to, or name of, a pinentry binary.

Returns None if:

  • A path was provided that does not exist.
  • A binary name was provided that cannot be found in PATH.
  • The binary is found but is not executable.

pub fn required(&mut self, empty_error: &'a str) -> &mut Self[src]

Prevents the user from submitting an empty passphrase.

The provided error text will be displayed if the user submits an empty passphrase. The dialog will remain open until the user either submits a non-empty passphrase, or selects the "Cancel" button.

pub fn with_title(&mut self, title: &'a str) -> &mut Self[src]

Sets the window title.

When using this feature you should take care that the window is still identifiable as the pinentry.

pub fn with_description(&mut self, description: &'a str) -> &mut Self[src]

Sets the descriptive text to display.

pub fn with_error(&mut self, error: &'a str) -> &mut Self[src]

Sets the error text to display.

This is used to display an error message, for example on a second interaction if the first passphrase was invalid.

pub fn with_prompt(&mut self, prompt: &'a str) -> &mut Self[src]

Sets the prompt to show.

When asking for a passphrase or PIN, this sets the text just before the widget for passphrase entry.

You should use an underscore in the text only if you know that a modern version of pinentry is used. Modern versions underline the next character after the underscore and use the first such underlined character as a keyboard accelerator. Use a double underscore to escape an underscore.

pub fn with_confirmation(
    &mut self,
    confirmation_prompt: &'a str,
    mismatch_error: &'a str
) -> &mut Self
[src]

Enables confirmation prompting.

When asking for a passphrase or PIN, this sets the text just before the widget for the passphrase confirmation entry.

You should use an underscore in the text only if you know that a modern version of pinentry is used. Modern versions underline the next character after the underscore and use the first such underlined character as a keyboard accelerator. Use a double underscore to escape an underscore.

pub fn with_ok(&mut self, ok: &'a str) -> &mut Self[src]

Sets the text for the button signalling confirmation (the "OK" button).

You should use an underscore in the text only if you know that a modern version of pinentry is used. Modern versions underline the next character after the underscore and use the first such underlined character as a keyboard accelerator. Use a double underscore to escape an underscore.

pub fn with_cancel(&mut self, cancel: &'a str) -> &mut Self[src]

Sets the text for the button signaling cancellation or disagreement (the "Cancel" button).

You should use an underscore in the text only if you know that a modern version of pinentry is used. Modern versions underline the next character after the underscore and use the first such underlined character as a keyboard accelerator. Use a double underscore to escape an underscore.

pub fn with_timeout(&mut self, timeout: u16) -> &mut Self[src]

Sets the timeout (in seconds) before returning an error.

pub fn interact(&self) -> Result<SecretString>[src]

Asks for a passphrase or PIN.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.