summaryrefslogtreecommitdiff
path: root/src/otp.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/otp.rs')
-rw-r--r--src/otp.rs28
1 files changed, 12 insertions, 16 deletions
diff --git a/src/otp.rs b/src/otp.rs
index 7145b6c..0d04e27 100644
--- a/src/otp.rs
+++ b/src/otp.rs
@@ -13,8 +13,8 @@ pub enum OtpMode {
/// Provides methods to configure and erase OTP slots on a Nitrokey device.
pub trait ConfigureOtp {
- /// Configure an HOTP slot with the given data and set the HOTP counter to
- /// the given value (default 0).
+ /// Configure an HOTP slot with the given data and set the HOTP counter to the given value
+ /// (default 0).
///
/// # Errors
///
@@ -49,8 +49,8 @@ pub trait ConfigureOtp {
/// [`NoName`]: enum.CommandError.html#variant.NoName
fn write_hotp_slot(&self, data: OtpSlotData, counter: u64) -> CommandStatus;
- /// Configure a TOTP slot with the given data and set the TOTP time window
- /// to the given value (default 30).
+ /// Configure a TOTP slot with the given data and set the TOTP time window to the given value
+ /// (default 30).
///
/// # Errors
///
@@ -207,9 +207,8 @@ pub trait GenerateOtp {
unsafe { result_from_string(nitrokey_sys::NK_get_totp_slot_name(slot)) }
}
- /// Generates an HOTP code on the given slot. This operation may require
- /// user authorization, depending on the device configuration (see
- /// [`get_config`][]).
+ /// Generates an HOTP code on the given slot. This operation may require user authorization,
+ /// depending on the device configuration (see [`get_config`][]).
///
/// # Errors
///
@@ -241,12 +240,11 @@ pub trait GenerateOtp {
}
}
- /// Generates a TOTP code on the given slot. This operation may require
- /// user authorization, depending on the device configuration (see
- /// [`get_config`][]).
+ /// Generates a TOTP code on the given slot. This operation may require user authorization,
+ /// depending on the device configuration (see [`get_config`][]).
///
- /// To make sure that the Nitrokey’s time is in sync, consider calling
- /// [`set_time`][] before calling this method.
+ /// To make sure that the Nitrokey’s time is in sync, consider calling [`set_time`][] before
+ /// calling this method.
///
/// # Errors
///
@@ -291,8 +289,7 @@ pub trait GenerateOtp {
/// The configuration for an OTP slot.
#[derive(Debug)]
pub struct OtpSlotData {
- /// The number of the slot – must be less than three for HOTP and less than
- /// 15 for TOTP.
+ /// The number of the slot – must be less than three for HOTP and less than 15 for TOTP.
pub number: u8,
/// The name of the slot – must not be empty.
pub name: String,
@@ -303,8 +300,7 @@ pub struct OtpSlotData {
/// If true, press the enter key after sending an OTP code using double-pressed
/// numlock, capslock or scrolllock.
pub use_enter: bool,
- /// Set the token ID, see [OATH Token Identifier Specification][tokspec], section
- /// “Class A”.
+ /// Set the token ID, see [OATH Token Identifier Specification][tokspec], section “Class A”.
///
/// [tokspec]: https://openauthentication.org/token-specs/
pub token_id: Option<String>,