Skip to main content

FileCa

Struct FileCa 

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

A CA kept in one file of the state directory, readable by its owner only.

It holds the root key too, so it can mint a new intermediate; a deployment that wants the root offline uses a CA of its own instead.

Implementations§

Source§

impl FileCa

Source

pub const FIRST_NODE_ID: u64 = 1

The first node id handed out; the controller takes one before any device does.

Source

pub fn open_or_create<C: Crypto>( path: &Path, fabric_id: Option<u64>, crypto: C, ) -> Result<Self, Error>

Open the CA in path, creating a new fabric fabric_id (random if None) with a new root and intermediate when there is none yet.

Trait Implementations§

Source§

impl CertificateAuthority for FileCa

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§

§

impl !Freeze for FileCa

§

impl !RefUnwindSafe for FileCa

§

impl !Sync for FileCa

§

impl Send for FileCa

§

impl Unpin for FileCa

§

impl UnsafeUnpin for FileCa

§

impl UnwindSafe for FileCa

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