Struct picky_asn1_x509::extension::Extension
source · 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.
pub fn new_crl_number<N: Into<OctetStringAsn1Container<IntegerAsn1>>>( number: N, ) -> Self
Trait Implementations§
source§impl<'de> Deserialize<'de> for Extension
impl<'de> Deserialize<'de> for Extension
source§fn deserialize<D>(
deserializer: D,
) -> Result<Self, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Self, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
source§impl PartialEq for Extension
impl PartialEq for Extension
source§impl Serialize for Extension
impl Serialize for Extension
source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
impl Eq for Extension
impl StructuralPartialEq for Extension
Auto Trait Implementations§
impl Freeze for Extension
impl RefUnwindSafe for Extension
impl Send for Extension
impl Sync for Extension
impl Unpin for Extension
impl UnwindSafe for Extension
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)