pub struct Extension { /* private fields */ }
Expand description
Implementations§
Source§impl Extension
impl Extension
pub fn extn_id(&self) -> &ObjectIdentifierAsn1
pub fn critical(&self) -> bool
pub fn extn_value(&self) -> ExtensionView<'_>
pub fn into_critical(self) -> Self
pub fn into_non_critical(self) -> Self
pub fn set_critical(&mut self, critical: bool)
Sourcepub fn new_key_usage(key_usage: KeyUsage) -> Self
pub fn new_key_usage(key_usage: KeyUsage) -> Self
When present, conforming CAs SHOULD mark this extension as critical
Default is critical.
Sourcepub fn new_subject_key_identifier<V: Into<Vec<u8>>>(ski: V) -> Self
pub fn new_subject_key_identifier<V: Into<Vec<u8>>>(ski: V) -> Self
Conforming CAs MUST mark this extension as non-critical
Default is non-critical.
Conforming CAs MUST mark this extension as non-critical
Default is critical.
Sourcepub fn new_basic_constraints<CA: Into<Option<bool>>, PLC: Into<Option<u8>>>(
ca: CA,
path_len_constraints: PLC,
) -> Self
pub fn new_basic_constraints<CA: Into<Option<bool>>, PLC: Into<Option<u8>>>( ca: CA, path_len_constraints: PLC, ) -> Self
Marking this extension as critical is always acceptable.
Check details here: https://tools.ietf.org/html/rfc5280#section-4.2.1.9
You may change this value using into_non_critical
or set_critical
methods.
Default is critical.
Sourcepub fn new_extended_key_usage<EKU>(extended_key_usage: EKU) -> Selfwhere
EKU: Into<ExtendedKeyUsage>,
pub fn new_extended_key_usage<EKU>(extended_key_usage: EKU) -> Selfwhere
EKU: Into<ExtendedKeyUsage>,
This extension MAY, at the option of the certificate issuer, be either critical or non-critical. Conforming CAs SHOULD NOT mark this extension as critical if the anyExtendedKeyUsage KeyPurposeId is present.
Default is non-critical if anyExtendedKeyUsage is present, critical otherwise.
Sourcepub fn new_subject_alt_name<N: Into<GeneralNames>>(name: N) -> Self
pub fn new_subject_alt_name<N: Into<GeneralNames>>(name: N) -> Self
If the subject field contains an empty sequence, then the issuing CA MUST include a subjectAltName extension that is marked as critical. When including the subjectAltName extension in a certificate that has a non-empty subject distinguished name, conforming CAs SHOULD mark the subjectAltName extension as non-critical.
Default is critical.
Sourcepub fn new_issuer_alt_name<N: Into<GeneralNames>>(name: N) -> Self
pub fn new_issuer_alt_name<N: Into<GeneralNames>>(name: N) -> Self
Where present, conforming CAs SHOULD mark this extension as non-critical.
Default is non-critical.