pub struct KeyPolicy {
pub persistent: bool,
pub sensitive: bool,
pub extractable: bool,
pub wrap_with_trusted_only: bool,
pub usages: KeyUsages,
}Expand description
Security and usage policy for a generated or imported key.
Backends that cannot honour a requested policy MUST return
BackendError::OperationNotPermitted rather than silently ignoring it.
For example, a PIV backend receiving extractable: true must reject it
because PIV keys are always non-extractable by hardware design.
Fields§
§persistent: boolKey persists after session ends. Always true for PIV. CKA_TOKEN in PKCS#11.
sensitive: boolKey material never revealed in plaintext. Always true for PIV. CKA_SENSITIVE.
extractable: boolKey can be wrapped and exported. Always false for PIV. CKA_EXTRACTABLE.
wrap_with_trusted_only: boolKey can only be wrapped by a CKA_TRUSTED wrapping key. PKCS#11 CKA_WRAP_WITH_TRUSTED.
usages: KeyUsagesWhat operations this key is permitted to perform.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for KeyPolicy
impl<'de> Deserialize<'de> for KeyPolicy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for KeyPolicy
impl RefUnwindSafe for KeyPolicy
impl Send for KeyPolicy
impl Sync for KeyPolicy
impl Unpin for KeyPolicy
impl UnsafeUnpin for KeyPolicy
impl UnwindSafe for KeyPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more