Skip to main content

Builder

Struct Builder 

Source
pub struct Builder { /* private fields */ }
Expand description

Builder for MatterCertificate. Construct via MatterCertificate::builder().

Implementations§

Source§

impl Builder

Source

pub fn serial(self, serial: Vec<u8>) -> Self

Set the certificate serial number (1..=20 raw bytes per spec §6.5.1).

Source

pub fn issuer(self, dn: DistinguishedName) -> Self

Set the issuer DN.

Source

pub fn subject(self, dn: DistinguishedName) -> Self

Set the subject DN.

Source

pub fn validity(self, not_before: MatterTime, not_after: MatterTime) -> Self

Set the validity window.

Source

pub fn public_key(self, pk: PublicKey) -> Self

Set the subject’s EC P-256 public key.

Source

pub fn extensions(self, ext: Extensions) -> Self

Set the extensions.

Source

pub fn build_unsigned(self) -> Result<UnsignedCertificate>

Validate that every required field is set and return an UnsignedCertificate ready to be hashed/signed.

§Errors

Returns Error::MissingBuilderField naming the first missing field, or Error::FieldValueOutOfRange if the serial number is empty or longer than the 20-byte maximum required by Matter spec §6.5.1.

Trait Implementations§

Source§

impl Debug for Builder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Builder

Source§

fn default() -> Builder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.