#[non_exhaustive]pub struct KeyUsageOptions {
pub digital_signature: bool,
pub content_commitment: bool,
pub key_encipherment: bool,
pub data_encipherment: bool,
pub key_agreement: bool,
pub cert_sign: bool,
pub crl_sign: bool,
pub encipher_only: bool,
pub decipher_only: bool,
/* private fields */
}Expand description
KeyUsage.KeyUsageOptions corresponds to the key usage values described in https://tools.ietf.org/html/rfc5280#section-4.2.1.3.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.digital_signature: boolThe key may be used for digital signatures.
content_commitment: boolThe key may be used for cryptographic commitments. Note that this may also be referred to as “non-repudiation”.
key_encipherment: boolThe key may be used to encipher other keys.
data_encipherment: boolThe key may be used to encipher data.
key_agreement: boolThe key may be used in a key agreement protocol.
cert_sign: boolThe key may be used to sign certificates.
crl_sign: boolThe key may be used sign certificate revocation lists.
encipher_only: boolThe key may be used to encipher only.
decipher_only: boolThe key may be used to decipher only.
Implementations§
Source§impl KeyUsageOptions
impl KeyUsageOptions
pub fn new() -> Self
Sourcepub fn set_digital_signature<T: Into<bool>>(self, v: T) -> Self
pub fn set_digital_signature<T: Into<bool>>(self, v: T) -> Self
Sets the value of digital_signature.
§Example
ⓘ
let x = KeyUsageOptions::new().set_digital_signature(true);Sourcepub fn set_content_commitment<T: Into<bool>>(self, v: T) -> Self
pub fn set_content_commitment<T: Into<bool>>(self, v: T) -> Self
Sets the value of content_commitment.
§Example
ⓘ
let x = KeyUsageOptions::new().set_content_commitment(true);Sourcepub fn set_key_encipherment<T: Into<bool>>(self, v: T) -> Self
pub fn set_key_encipherment<T: Into<bool>>(self, v: T) -> Self
Sets the value of key_encipherment.
§Example
ⓘ
let x = KeyUsageOptions::new().set_key_encipherment(true);Sourcepub fn set_data_encipherment<T: Into<bool>>(self, v: T) -> Self
pub fn set_data_encipherment<T: Into<bool>>(self, v: T) -> Self
Sets the value of data_encipherment.
§Example
ⓘ
let x = KeyUsageOptions::new().set_data_encipherment(true);Sourcepub fn set_key_agreement<T: Into<bool>>(self, v: T) -> Self
pub fn set_key_agreement<T: Into<bool>>(self, v: T) -> Self
Sourcepub fn set_cert_sign<T: Into<bool>>(self, v: T) -> Self
pub fn set_cert_sign<T: Into<bool>>(self, v: T) -> Self
Sourcepub fn set_crl_sign<T: Into<bool>>(self, v: T) -> Self
pub fn set_crl_sign<T: Into<bool>>(self, v: T) -> Self
Sourcepub fn set_encipher_only<T: Into<bool>>(self, v: T) -> Self
pub fn set_encipher_only<T: Into<bool>>(self, v: T) -> Self
Sourcepub fn set_decipher_only<T: Into<bool>>(self, v: T) -> Self
pub fn set_decipher_only<T: Into<bool>>(self, v: T) -> Self
Trait Implementations§
Source§impl Clone for KeyUsageOptions
impl Clone for KeyUsageOptions
Source§fn clone(&self) -> KeyUsageOptions
fn clone(&self) -> KeyUsageOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KeyUsageOptions
impl Debug for KeyUsageOptions
Source§impl Default for KeyUsageOptions
impl Default for KeyUsageOptions
Source§fn default() -> KeyUsageOptions
fn default() -> KeyUsageOptions
Returns the “default value” for a type. Read more
Source§impl Message for KeyUsageOptions
impl Message for KeyUsageOptions
Source§impl PartialEq for KeyUsageOptions
impl PartialEq for KeyUsageOptions
impl StructuralPartialEq for KeyUsageOptions
Auto Trait Implementations§
impl Freeze for KeyUsageOptions
impl RefUnwindSafe for KeyUsageOptions
impl Send for KeyUsageOptions
impl Sync for KeyUsageOptions
impl Unpin for KeyUsageOptions
impl UnwindSafe for KeyUsageOptions
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