pub struct Extensions<'a> { /* private fields */ }rustcrypto only.Expand description
The extensions of a Matter certificate, in the order they were encoded (§6.5.11).
The order is not incidental. §6.5.12: “The extensions SHALL appear in the same order in the Matter certificate and in the corresponding X.509 certificates” — and an X.509 certificate’s extension order is the issuer’s choice. Sorting them here would change the DER regenerated from this certificate, and a changed DER is a signature that does not verify. So this is a sequence with accessors, not a record with fields.
What is enforced is uniqueness: “The extensions list SHALL NOT contain more than one
instance of a particular extension”, with future-extension excepted because “There MAY
be more than one”.
Implementations§
Source§impl<'a> Extensions<'a>
impl<'a> Extensions<'a>
Sourcepub fn push(&mut self, extension: Extension<'a>) -> Result<()>
pub fn push(&mut self, extension: Extension<'a>) -> Result<()>
Appends an extension, refusing a second instance of anything but future-extension.
Sourcepub fn basic_constraints(&self) -> Option<BasicConstraints>
pub fn basic_constraints(&self) -> Option<BasicConstraints>
The basic-cnstr extension, if present.
Sourcepub fn extended_key_usage(&self) -> Option<&[KeyPurposeId]>
pub fn extended_key_usage(&self) -> Option<&[KeyPurposeId]>
The extended-key-usage array, if present, in its encoded order.
Sourcepub fn subject_key_id(&self) -> Option<[u8; 20]>
pub fn subject_key_id(&self) -> Option<[u8; 20]>
The subject-key-id, if present.
The authority-key-id, if present.