use crate::{
command::{self, Command},
hmac, object,
response::Response,
};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug)]
pub(crate) struct SignHmacCommand {
pub key_id: object::Id,
pub data: Vec<u8>,
}
impl Command for SignHmacCommand {
type ResponseType = SignHmacResponse;
}
#[derive(Serialize, Deserialize, Debug)]
pub struct SignHmacResponse(pub(crate) hmac::Tag);
impl Response for SignHmacResponse {
const COMMAND_CODE: command::Code = command::Code::SignHmac;
}
impl From<SignHmacResponse> for hmac::Tag {
fn from(response: SignHmacResponse) -> hmac::Tag {
response.0
}
}