summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/device.rs64
1 files changed, 0 insertions, 64 deletions
diff --git a/src/device.rs b/src/device.rs
index 277218e..7387dd9 100644
--- a/src/device.rs
+++ b/src/device.rs
@@ -586,36 +586,6 @@ impl<T: Device> User<T> {
}
impl<T: Device> GenerateOtp for User<T> {
- /// Generates an HOTP code on the given slot. This operation may not require user
- /// authorization, depending on the device configuration (see [`get_config`][]).
- ///
- /// # Errors
- ///
- /// - [`SlotNotProgrammed`][] if the given slot is not configured
- /// - [`WrongSlot`][] if there is no slot with the given number
- ///
- /// # Example
- ///
- /// ```no_run
- /// use nitrokey::{Authenticate, GenerateOtp};
- /// # use nitrokey::CommandError;
- ///
- /// # fn try_main() -> Result<(), CommandError> {
- /// let device = nitrokey::connect()?;
- /// match device.authenticate_user("123456") {
- /// Ok(user) => {
- /// let code = user.get_hotp_code(1)?;
- /// println!("Generated HOTP code on slot 1: {:?}", code);
- /// },
- /// Err(err) => println!("Could not authenticate: {:?}", err),
- /// };
- /// # Ok(())
- /// # }
- /// ```
- ///
- /// [`get_config`]: trait.Device.html#method.get_config
- /// [`SlotNotProgrammed`]: enum.CommandError.html#variant.SlotNotProgrammed
- /// [`WrongSlot`]: enum.CommandError.html#variant.WrongSlot
fn get_hotp_code(&self, slot: u8) -> Result<String, CommandError> {
unsafe {
let temp_password_ptr = self.temp_password.as_ptr() as *const i8;
@@ -623,40 +593,6 @@ impl<T: Device> GenerateOtp for User<T> {
}
}
- /// Generates a TOTP code on the given slot. This operation may not 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.
- ///
- /// # Errors
- ///
- /// - [`SlotNotProgrammed`][] if the given slot is not configured
- /// - [`WrongSlot`][] if there is no slot with the given number
- ///
- /// # Example
- ///
- /// ```no_run
- /// use nitrokey::{Authenticate, GenerateOtp};
- /// # use nitrokey::CommandError;
- ///
- /// # fn try_main() -> Result<(), CommandError> {
- /// let device = nitrokey::connect()?;
- /// match device.authenticate_user("123456") {
- /// Ok(user) => {
- /// let code = user.get_totp_code(1)?;
- /// println!("Generated TOTP code on slot 1: {:?}", code);
- /// },
- /// Err(err) => println!("Could not authenticate: {:?}", err),
- /// };
- /// # Ok(())
- /// # }
- /// ```
- ///
- /// [`get_config`]: trait.Device.html#method.get_config
- /// [`set_time`]: trait.Device.html#method.set_time
- /// [`SlotNotProgrammed`]: enum.CommandError.html#variant.SlotNotProgrammed
- /// [`WrongSlot`]: enum.CommandError.html#variant.WrongSlot
fn get_totp_code(&self, slot: u8) -> Result<String, CommandError> {
unsafe {
let temp_password_ptr = self.temp_password.as_ptr() as *const i8;