use super::securechannel::{Challenge, Cryptogram};
use crate::{
command::{self, Command},
object,
response::Response,
};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug)]
pub(crate) struct CreateSessionCommand {
pub authentication_key_id: object::Id,
pub host_challenge: Challenge,
}
impl Command for CreateSessionCommand {
type ResponseType = CreateSessionResponse;
}
#[derive(Serialize, Deserialize, Debug)]
pub(crate) struct CreateSessionResponse {
pub card_challenge: Challenge,
pub card_cryptogram: Cryptogram,
}
impl Response for CreateSessionResponse {
const COMMAND_CODE: command::Code = command::Code::CreateSession;
}
#[derive(Serialize, Deserialize, Debug)]
pub(super) struct CloseSessionCommand {}
impl Command for CloseSessionCommand {
type ResponseType = CloseSessionResponse;
}
#[derive(Serialize, Deserialize, Debug)]
pub(crate) struct CloseSessionResponse {}
impl Response for CloseSessionResponse {
const COMMAND_CODE: command::Code = command::Code::CloseSession;
}