ctap2-proto: Add authenticator::client_pin::raw::RawSubcommand

This type is used for serialization and deserialization of subcommands
as raw u8s.
main
Nick Zana 11 months ago
parent df78c9e303
commit 10bdfc1547

@ -2,5 +2,25 @@
//! possible in CBOR format while maintaining ergonomic enum variants for public
//! API.
use serde::{Deserialize, Serialize};
mod public_key;
#[derive(Clone, Serialize, Deserialize)]
#[serde(into = "u8")]
pub(crate) enum RawSubcommand {
GetPinRetries = 0x01,
GetKeyAgreement = 0x02,
SetPin = 0x03,
ChangePin = 0x04,
GetPinToken = 0x05,
GetPinUvAuthTokenUsingUvWithPermissions = 0x06,
GetUvRetries = 0x07,
GetPinUvAuthTokenUsingPinWithPermissions = 0x09,
}
impl From<RawSubcommand> for u8 {
fn from(value: RawSubcommand) -> Self {
value as u8
}
}

Loading…
Cancel
Save