Skip to content

Commit

Permalink
Add get_application_key method to clients
Browse files Browse the repository at this point in the history
  • Loading branch information
sosthene-nitrokey authored and daringer committed Apr 25, 2023
1 parent 1397030 commit 92dbe32
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub mod request;
use serde::{Deserialize, Serialize};
use trussed::{
serde_extensions::{Extension, ExtensionClient, ExtensionResult},
types::KeyId,
types::{KeyId, Message},
};

use crate::{Pin, PinId};
Expand Down Expand Up @@ -172,6 +172,14 @@ pub trait AuthClient: ExtensionClient<AuthExtension> {
fn pin_retries<I: Into<PinId>>(&mut self, id: I) -> AuthResult<'_, reply::PinRetries, Self> {
self.extension(request::PinRetries { id: id.into() })
}

/// Returns a keyid that is persistent given the "info" parameter
fn get_application_key(
&mut self,
info: Message,
) -> AuthResult<'_, reply::GetApplicationKey, Self> {
self.extension(request::GetApplicationKey { info })
}
}

impl<C: ExtensionClient<AuthExtension>> AuthClient for C {}

0 comments on commit 92dbe32

Please sign in to comment.