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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)