use crate::{
command::{self, Command},
object,
response::Response,
rsa,
};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug)]
pub(crate) struct SignPkcs1Command {
pub key_id: object::Id,
pub digest: Vec<u8>,
}
impl Command for SignPkcs1Command {
type ResponseType = SignPkcs1Response;
}
#[derive(Serialize, Deserialize, Debug)]
pub struct SignPkcs1Response(rsa::pkcs1::Signature);
impl Response for SignPkcs1Response {
const COMMAND_CODE: command::Code = command::Code::SignPkcs1;
}
impl From<SignPkcs1Response> for rsa::pkcs1::Signature {
fn from(response: SignPkcs1Response) -> rsa::pkcs1::Signature {
response.0
}
}