pub struct Identity {
pub cert_der: Vec<u8>,
pub key_der: Vec<u8>,
pub fingerprint: String,
}Expand description
This device’s certificate and key. The fingerprint the protocol asks for is
the SHA-256 of the certificate (DER), as lowercase hex. The host stores the
two DER blobs (a Keychain item, or a file it protects) and hands them back
through Identity::load; the crate never writes key material.
Fields§
§cert_der: Vec<u8>§key_der: Vec<u8>§fingerprint: StringImplementations§
Source§impl Identity
impl Identity
Sourcepub fn generate(alias: &str) -> Result<Identity>
pub fn generate(alias: &str) -> Result<Identity>
A new identity: a fresh P-256 key and a self-signed certificate whose
common name is alias (control characters removed, at most 64 characters).
The host must store both cert_der and key_der and reuse them on every
start. A new identity has a new fingerprint, so other devices treat it as
a stranger.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Identity
impl RefUnwindSafe for Identity
impl Send for Identity
impl Sync for Identity
impl Unpin for Identity
impl UnsafeUnpin for Identity
impl UnwindSafe for Identity
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