use crate::{
command::{self, Command},
object,
response::Response,
rsa,
};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug)]
pub(crate) struct SignPssCommand {
pub key_id: object::Id,
pub mgf1_hash_alg: rsa::mgf::Algorithm,
pub salt_len: u16,
pub digest: Vec<u8>,
}
impl Command for SignPssCommand {
type ResponseType = SignPssResponse;
}
#[derive(Serialize, Deserialize, Debug)]
pub struct SignPssResponse(rsa::pss::Signature);
impl Response for SignPssResponse {
const COMMAND_CODE: command::Code = command::Code::SignPss;
}
impl From<SignPssResponse> for rsa::pss::Signature {
fn from(response: SignPssResponse) -> rsa::pss::Signature {
response.0
}
}