[][src]Struct yubirs::otp::result::VerificationResult

pub struct VerificationResult {
    pub otp: Option<String>,
    pub nonce: Option<String>,
    pub signature: Vec<u8>,
    pub timestamp: DateTime<Utc>,
    pub status: Status,
    pub decrypted_timestamp: Option<String>,
    pub decrypted_use_counter: Option<String>,
    pub decrypted_session_use_counter: Option<String>,
    pub success_percent: Option<u8>,
    // some fields omitted
}

This structure provides type-safe access to all of the fields which may appear in a response / verification result from the Yubico API. More details on what the fields mean are in the official documentation: https://developers.yubico.com/OTP/Specifications/OTP_validation_protocol.html.

Fields

otp: Option<String>nonce: Option<String>signature: Vec<u8>timestamp: DateTime<Utc>status: Statusdecrypted_timestamp: Option<String>decrypted_use_counter: Option<String>decrypted_session_use_counter: Option<String>success_percent: Option<u8>

Methods

impl VerificationResult[src]

pub fn new(
    api_key: &[u8],
    expected_otp: &Otp,
    expected_nonce: &str,
    response: Vec<u8>
) -> Result<VerificationResult>
[src]

Parse the given raw HTTP response into a result structure. Use the other pieces of information to verify that the response is valid (i.e., the contents and signature match what we expect).

pub fn is_valid(&self) -> bool[src]

Returns true if and only if the result indicates that the OTP was successfully verified.

pub fn is_retryable_error(&self) -> bool[src]

Returns true if this error is retryable (i.e., the request may actually succeed if we try it again).

Trait Implementations

impl Clone for VerificationResult[src]

impl Debug for VerificationResult[src]

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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>,