#[non_exhaustive]pub struct KeyPolicyParams {
pub persistent: Option<bool>,
pub sensitive: Option<bool>,
pub extractable: Option<bool>,
pub wrap_with_trusted_only: Option<bool>,
pub usages: Option<Vec<KeyUsage>>,
}Expand description
The policy: block, mirroring KeyPolicy field
for field.
Every field is optional and falls back to the restrictive choice: a
persistent, sensitive, non-extractable key. The usages fall back to what the
algorithm permits, by
KeyPolicy::default_for, so a keypair
may sign and verify and a symmetric key may wrap and unwrap. A ceremony that
wraps a key it generated has to say extractable: true, because otherwise
the key cannot leave the backend and the wrap step will refuse.
This is PKCS#11 vocabulary: what the token permits. The KeyUsage
extension in a certificate is a different thing, settled by profile: on
issue_certificate.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.persistent: Option<bool>Key survives the session. CKA_TOKEN.
sensitive: Option<bool>Key material is never revealed in plaintext. CKA_SENSITIVE.
extractable: Option<bool>Key may be wrapped and leave the backend. CKA_EXTRACTABLE.
wrap_with_trusted_only: Option<bool>Key may only be wrapped by a trusted wrapping key.
CKA_WRAP_WITH_TRUSTED.
usages: Option<Vec<KeyUsage>>Operations the key is permitted to perform: sign, verify,
encrypt, decrypt, wrap, unwrap, derive.
Implementations§
Source§impl KeyPolicyParams
impl KeyPolicyParams
Sourcepub fn resolve_from(&self, defaults: &KeyPolicy) -> KeyPolicy
pub fn resolve_from(&self, defaults: &KeyPolicy) -> KeyPolicy
Resolve the declared policy against a base.
The base is the caller’s to choose, because what a key may do when the
ceremony says nothing follows from its algorithm: see
KeyPolicy::default_for.
Trait Implementations§
Source§impl Clone for KeyPolicyParams
impl Clone for KeyPolicyParams
Source§impl Debug for KeyPolicyParams
impl Debug for KeyPolicyParams
Source§impl Default for KeyPolicyParams
impl Default for KeyPolicyParams
Source§impl<'de> Deserialize<'de> for KeyPolicyParams
impl<'de> Deserialize<'de> for KeyPolicyParams
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>,
Source§impl JsonSchema for KeyPolicyParams
impl JsonSchema for KeyPolicyParams
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more