diff options
Diffstat (limited to 'nitrocli/src/commands.rs')
-rw-r--r-- | nitrocli/src/commands.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/nitrocli/src/commands.rs b/nitrocli/src/commands.rs index c903cfd..1b26326 100644 --- a/nitrocli/src/commands.rs +++ b/nitrocli/src/commands.rs @@ -340,6 +340,13 @@ pub fn config_set( .map_err(|err| get_error("Could not set configuration", &err)) } +/// Lock the Nitrokey device. +pub fn lock() -> Result<()> { + get_device()? + .lock() + .map_err(|err| get_error("Getting Storage status failed", &err)) +} + fn get_otp<T: GenerateOtp>(slot: u8, algorithm: args::OtpAlgorithm, device: &T) -> Result<String> { match algorithm { args::OtpAlgorithm::Hotp => device.get_hotp_code(slot), |