pub struct KeyUsage { /* private fields */ }
Expand description
The expected key usage of a certificate.
This type represents the expected key usage of an end entity certificate. Although for most kinds of certificates the extended key usage extension is optional (and so certificates not carrying a particular value in the EKU extension are acceptable). If the extension is present, the certificate MUST only be used for one of the purposes indicated.
Implementations§
Source§impl KeyUsage
impl KeyUsage
Sourcepub const fn server_auth() -> Self
pub const fn server_auth() -> Self
Construct a new KeyUsage
as appropriate for server certificate authentication.
As specified in https://www.rfc-editor.org/rfc/rfc5280#section-4.2.1.12, this does not require the certificate to specify the eKU extension.
Sourcepub const fn client_auth() -> Self
pub const fn client_auth() -> Self
Construct a new KeyUsage
as appropriate for client certificate authentication.
As specified in <>, this does not require the certificate to specify the eKU extension.
Sourcepub const fn required(oid: &'static [u8]) -> Self
pub const fn required(oid: &'static [u8]) -> Self
Construct a new KeyUsage
requiring a certificate to support the specified OID.
Sourcepub const fn required_if_present(oid: &'static [u8]) -> Self
pub const fn required_if_present(oid: &'static [u8]) -> Self
Construct a new KeyUsage
requiring a certificate to support the specified OID, if the certificate has EKUs.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeyUsage
impl RefUnwindSafe for KeyUsage
impl Send for KeyUsage
impl Sync for KeyUsage
impl Unpin for KeyUsage
impl UnwindSafe for KeyUsage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 24 bytes