pub struct DeviceIdentity {
pub device_id: [u8; 16],
pub public_key: [u8; 32],
/* private fields */
}Expand description
Device identity containing signing keys and derived key agreement keys
Fields§
§device_id: [u8; 16]Device ID (BLAKE3-16 of Ed25519 public key)
public_key: [u8; 32]Ed25519 public key for signatures
Implementations§
Source§impl DeviceIdentity
impl DeviceIdentity
Sourcepub fn x25519_public_key(&self) -> [u8; 32]
pub fn x25519_public_key(&self) -> [u8; 32]
Get the X25519 public key for key agreement
Sourcepub fn agree(&self, remote_x25519_public: &[u8; 32]) -> Result<[u8; 32]>
pub fn agree(&self, remote_x25519_public: &[u8; 32]) -> Result<[u8; 32]>
Perform key agreement with a remote public key to derive a shared secret. Returns an error if the DH result is all-zero (low-order point).
Sourcepub fn pair_with(
&self,
remote_public_key: &[u8; 32],
remote_x25519_public: &[u8; 32],
) -> Result<PairedDevice>
pub fn pair_with( &self, remote_public_key: &[u8; 32], remote_x25519_public: &[u8; 32], ) -> Result<PairedDevice>
Pair with a remote device to create a PairedDevice
Sourcepub fn export_seed(&self) -> [u8; 32]
pub fn export_seed(&self) -> [u8; 32]
Export the identity seed (for backup/recovery)
Trait Implementations§
Source§impl Clone for DeviceIdentity
impl Clone for DeviceIdentity
Source§fn clone(&self) -> DeviceIdentity
fn clone(&self) -> DeviceIdentity
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DeviceIdentity
impl RefUnwindSafe for DeviceIdentity
impl Send for DeviceIdentity
impl Sync for DeviceIdentity
impl Unpin for DeviceIdentity
impl UnsafeUnpin for DeviceIdentity
impl UnwindSafe for DeviceIdentity
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