pub struct FileCertManager { /* private fields */ }
Expand description
Example implementation of CertManager trait. It stores keys and certificates in PEM files in specified directory.
Implementations§
Source§impl FileCertManager
impl FileCertManager
Sourcepub fn bootstrap(&self) -> Result<()>
pub fn bootstrap(&self) -> Result<()>
Initialize CA. Create directory, generate CA key and certificate and store them in specified directory. Directory must not exist before calling this function. If it exists function will fail.
Sourcepub fn create_user(&self, id: u64) -> Result<()>
pub fn create_user(&self, id: u64) -> Result<()>
Create key and certificate for specified node identifier. This can be used as credentials for admin(and any additional) user controlling devices.
Trait Implementations§
Source§impl CertManager for FileCertManager
impl CertManager for FileCertManager
fn get_ca_cert(&self) -> Result<Vec<u8>>
fn get_ca_key(&self) -> Result<SecretKey>
fn get_user_cert(&self, id: u64) -> Result<Vec<u8>>
fn get_user_key(&self, id: u64) -> Result<SecretKey>
fn get_ca_public_key(&self) -> Result<Vec<u8>>
fn get_fabric_id(&self) -> u64
Auto Trait Implementations§
impl Freeze for FileCertManager
impl RefUnwindSafe for FileCertManager
impl Send for FileCertManager
impl Sync for FileCertManager
impl Unpin for FileCertManager
impl UnwindSafe for FileCertManager
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
Mutably borrows from an owned value. Read more