[−][src]Struct yubirs::otp::client::Client
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]
protocol: Protocol,
api_server: &str,
client_id: &str,
api_key: &str
) -> Result<Client>
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]
&self,
otp: &str,
timestamp: bool,
success_percentage: Option<SuccessPercentage>,
timeout: Option<u64>
) -> Result<VerificationResult>
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]
&self,
timestamp: bool,
success_percentage: Option<SuccessPercentage>,
timeout: Option<u64>
) -> Result<VerificationResult>
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,