use super::OperationFamily;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub enum PlatformKeyOperation {
Generate,
GetPublicKey,
Sign,
Verify,
DeriveSharedSecret,
Delete,
Attest,
}
impl PlatformKeyOperation {
#[must_use]
pub const fn family(self) -> OperationFamily {
OperationFamily::PlatformKey
}
#[must_use]
pub const fn requires_existing_key(self) -> bool {
!matches!(self, Self::Generate)
}
#[must_use]
pub const fn produces_secret_material(self) -> bool {
matches!(self, Self::DeriveSharedSecret)
}
}