diff --git a/crates/ctap2-proto/src/authenticator/client_pin/raw/mod.rs b/crates/ctap2-proto/src/authenticator/client_pin/raw/mod.rs index 587d7ea..50848e1 100644 --- a/crates/ctap2-proto/src/authenticator/client_pin/raw/mod.rs +++ b/crates/ctap2-proto/src/authenticator/client_pin/raw/mod.rs @@ -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 for u8 { + fn from(value: RawSubcommand) -> Self { + value as u8 + } +} +