pub struct Rfc6238 { /* private fields */ }Expand description
Implementations§
Source§impl Rfc6238
impl Rfc6238
Sourcepub fn new(
digits: usize,
secret: Vec<u8>,
issuer: Option<String>,
account_name: String,
) -> Result<Rfc6238, Rfc6238Error>
pub fn new( digits: usize, secret: Vec<u8>, issuer: Option<String>, account_name: String, ) -> Result<Rfc6238, Rfc6238Error>
Create an rfc-6238 compliant set of options that can be turned into a TOTP.
§Errors
will return a Rfc6238Error when
digitsis lower than 6 or higher than 8.secretis smaller than 128 bits (16 characters).
Sourcepub fn with_defaults(secret: Vec<u8>) -> Result<Rfc6238, Rfc6238Error>
pub fn with_defaults(secret: Vec<u8>) -> Result<Rfc6238, Rfc6238Error>
Create an rfc-6238 compliant set of options that can be turned into a TOTP,
with a default value of 6 for digits, None issuer and an empty account.
§Errors
will return a Rfc6238Error when
digitsis lower than 6 or higher than 8.secretis smaller than 128 bits (16 characters).
Sourcepub fn account_name(&mut self, value: String)
pub fn account_name(&mut self, value: String)
Set the account_name.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Rfc6238
impl RefUnwindSafe for Rfc6238
impl Send for Rfc6238
impl Sync for Rfc6238
impl Unpin for Rfc6238
impl UnwindSafe for Rfc6238
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more