use crate::{
command::{self, Command},
ecdh, object,
response::Response,
};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug)]
pub(crate) struct DeriveEcdhCommand {
pub key_id: object::Id,
pub public_key: ecdh::UncompressedPoint,
}
impl Command for DeriveEcdhCommand {
type ResponseType = DeriveEcdhResponse;
}
#[derive(Serialize, Deserialize, Debug)]
pub struct DeriveEcdhResponse(ecdh::UncompressedPoint);
impl Response for DeriveEcdhResponse {
const COMMAND_CODE: command::Code = command::Code::DeriveEcdh;
}
impl From<DeriveEcdhResponse> for ecdh::UncompressedPoint {
fn from(response: DeriveEcdhResponse) -> ecdh::UncompressedPoint {
response.0
}
}