Skip to main content

IntermediateCa

Struct IntermediateCa 

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

An intermediate CA whose certificate a root CA elsewhere issued (a platform’s, holding one fabric’s root for several controllers), for a key made here that never leaves this controller.

  1. IntermediateCa::csr makes the key (once) and returns its CSR.
  2. The root CA issues the intermediate certificate and a range of node ids.
  3. IntermediateCa::install stores them with the key; from then on the controller signs its own and its devices’ certificates, and every controller of the fabric reaches every device of it.

Implementations§

Source§

impl IntermediateCa

Source

pub fn csr<C: Crypto>(path: &Path, crypto: C) -> Result<Vec<u8>, Error>

The CSR (DER PKCS#10) for this controller’s intermediate key, made on the first call and the same on later ones until Self::install.

Source

pub fn install(path: &Path, issued: Issued) -> Result<(), Error>

Store what the root CA issued for the CSR from Self::csr.

Source

pub fn installed(path: &Path) -> bool

Whether credentials are installed at path.

Source

pub fn open(path: &Path) -> Result<Self, Error>

Open the installed intermediate CA at path.

Source

pub fn node_ids_left(&self) -> u64

Node ids left in the range.

Source

pub fn extend_node_ids(&self, range: NodeIdRange) -> Result<(), Error>

Take a further range from the root CA.

Trait Implementations§

Source§

impl CertificateAuthority for IntermediateCa

Source§

fn fabric_id(&self) -> u64

The fabric id.
Source§

fn root_cert(&self) -> &[u8] ⓘ

The root certificate (RCAC), Matter TLV encoding.
Source§

fn intermediate_cert(&self) -> Option<&[u8]>

The intermediate certificate (ICAC) NOCs are signed with, Matter TLV encoding, or None when the root signs them directly.
Source§

async fn allocate_node_id(&self) -> Result<u64, Error>

Allocate a node id that no other node of the fabric has.
Source§

async fn issue_noc<C: Crypto>( &self, crypto: C, csr: &[u8], node_id: u64, cats: &[u32], ) -> Result<Vec<u8>, Error>

Issue a NOC for the public key in csr (DER PKCS#10) and node_id, with up to three CASE Authenticated Tags.
Source§

fn signing_key(&self) -> Option<&[u8; 32]>

The key NOCs are signed with, if this process holds it.
Source§

fn ipk(&self) -> &[u8; 16]

The fabric’s identity protection key (IPK) epoch key. Every controller and node of the fabric has the same one; CASE needs it.
Source§

fn admin_cat(&self) -> Option<u32>

A CASE Authenticated Tag every controller of the fabric carries in its certificate, if the fabric uses one.

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.

§

impl<T> Init<T> for T

§

unsafe fn __init(self, slot: *mut T) -> Result<(), !>

Initializes slot. Read more
§

fn chain<F>(self, f: F) -> ChainInit<Self, F, T, E>
where F: FnOnce(&mut T) -> Result<(), E>,

First initializes the value using self then calls the function f with the initialized value. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T, I> IntoFallibleInit<T> for I
where I: Init<T>,

§

fn into_fallible<E>(self) -> impl Init<T, E>

Convert the infallible initializer to a fallible one.
§

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

§

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

§

impl<Source, Target> OctetsInto<Target> for Source
where Target: OctetsFrom<Source>,

§

type Error = <Target as OctetsFrom<Source>>::Error

§

fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>

Performs the conversion.
§

fn octets_into(self) -> Target
where Self::Error: Into<!>,

Performs an infallible conversion.
§

impl<T> PinInit<T> for T

§

unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), !>

Initializes slot. Read more
§

fn pin_chain<F>(self, f: F) -> ChainPinInit<Self, F, T, E>
where F: FnOnce(Pin<&mut T>) -> Result<(), E>,

First initializes the value using self then calls the function f with the initialized value. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more