[][src]Struct yubirs::otp::client::Client

pub struct Client { /* fields omitted */ }

Client is an opaque structure which manages the state and configuration used to make verification requests.

Methods

impl Client[src]

pub fn new(
    protocol: Protocol,
    api_server: &str,
    client_id: &str,
    api_key: &str
) -> Result<Client>
[src]

Create a new, fully-customized client. The API server should be given without a protocol on the front - for example, "api.yubico.com/wsapi/2.0/verify". If you don't have a client ID / API key pair, you can get one here: https://upgrade.yubico.com/getapikey/.

pub fn default(client_id: &str, api_key: &str) -> Result<Client>[src]

Create a new client using the default / recommended protocol and API server.

pub fn verify(
    &self,
    otp: &str,
    timestamp: bool,
    success_percentage: Option<SuccessPercentage>,
    timeout: Option<u64>
) -> Result<VerificationResult>
[src]

Verify the given YubiKey OTP string. If some internal error occurs, an error will be returned. Otherwise, even if the key is invalid, a VerificationResult structure will be returned. It is up to the caller to check .is_valid() to see if the OTP was accepted.

pub fn verify_default(&self, otp: &str) -> Result<VerificationResult>[src]

Call .verify(), with most options set to sane default values. Timestamp information will be returned, we'll use the "secure" success percentage, and we'll let the server choose a timeout value.

pub fn verify_prompt(
    &self,
    timestamp: bool,
    success_percentage: Option<SuccessPercentage>,
    timeout: Option<u64>
) -> Result<VerificationResult>
[src]

Prompt for a YubiKey OTP (wait for a "touch"), and then verify it as per verify().

pub fn verify_prompt_default(&self) -> Result<VerificationResult>[src]

Call .verify_prompt(), with most options set to sane default values. Timestamp information will be returned, we'll use the "secure" success percentage, and we'll let the server choose a timeout value.

Auto Trait Implementations

impl RefUnwindSafe for Client

impl Send for Client

impl Sync for Client

impl Unpin for Client

impl UnwindSafe for Client

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,