use crate::{
algorithm::Algorithm,
command::{self, Command},
object,
response::Response,
ssh,
};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug)]
pub(crate) struct SignSshCertificateCommand {
pub key_id: object::Id,
pub template_id: object::Id,
pub algorithm: Algorithm,
pub timestamp: u32,
pub signature: [u8; 32],
pub request: Vec<u8>,
}
impl Command for SignSshCertificateCommand {
type ResponseType = SignSshCertificateResponse;
}
#[derive(Serialize, Deserialize, Debug)]
pub struct SignSshCertificateResponse(ssh::Certificate);
impl Response for SignSshCertificateResponse {
const COMMAND_CODE: command::Code = command::Code::SignSshCertificate;
}
impl From<SignSshCertificateResponse> for ssh::Certificate {
fn from(response: SignSshCertificateResponse) -> ssh::Certificate {
response.0
}
}