pub struct DeviceKey(/* private fields */);Expand description
A device’s private signing key. Generated on the device and never sent anywhere.
Implementations§
Source§impl DeviceKey
impl DeviceKey
Sourcepub fn seed(&self) -> [u8; 32]
pub fn seed(&self) -> [u8; 32]
The 32 secret bytes everything else derives from; what to store.
Sourcepub fn load(path: &Path) -> Result<Option<Self>>
pub fn load(path: &Path) -> Result<Option<Self>>
Reads a key saved with DeviceKey::save; None if there’s no
such file.
Sourcepub fn save(&self, path: &Path) -> Result<()>
pub fn save(&self, path: &Path) -> Result<()>
Writes the seed to path, readable by the owner only. Refuses to
overwrite an existing key.
Sourcepub fn keypair_bytes(&self) -> [u8; 64]
pub fn keypair_bytes(&self) -> [u8; 64]
Seed and public key, as PASETO v4 secret keys are laid out.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DeviceKey
impl RefUnwindSafe for DeviceKey
impl Send for DeviceKey
impl Sync for DeviceKey
impl Unpin for DeviceKey
impl UnsafeUnpin for DeviceKey
impl UnwindSafe for DeviceKey
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