pub struct ExtendedKeyUsage { /* 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 ExtendedKeyUsage
impl ExtendedKeyUsage
Sourcepub const SERVER_AUTH: Self
pub const SERVER_AUTH: Self
An ExtendedKeyUsage 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 CLIENT_AUTH: Self
pub const CLIENT_AUTH: Self
An ExtendedKeyUsage as appropriate for client 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 SERVER_AUTH_REPR: &[usize]
pub const SERVER_AUTH_REPR: &[usize]
Human-readable representation of the server authentication OID.
Sourcepub const CLIENT_AUTH_REPR: &[usize]
pub const CLIENT_AUTH_REPR: &[usize]
Human-readable representation of the client authentication OID.
Sourcepub const fn required(oid: &'static [u8]) -> Self
pub const fn required(oid: &'static [u8]) -> Self
Construct a new ExtendedKeyUsage 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 ExtendedKeyUsage requiring a certificate to support the specified OID, if the certificate has EKUs.
Sourcepub fn oid_values(&self) -> impl Iterator<Item = usize> + '_
pub fn oid_values(&self) -> impl Iterator<Item = usize> + '_
Yield the OID values of the required extended key usage.