pub struct KeyPair { /* private fields */ }Expand description
Ed25519 keypair used to sign capsules and related provenance claims.
Implementations§
Source§impl KeyPair
impl KeyPair
Sourcepub fn from_bytes(bytes: &[u8; 32]) -> Result<Self, CryptoError>
pub fn from_bytes(bytes: &[u8; 32]) -> Result<Self, CryptoError>
Constructs a keypair from a 32-byte Ed25519 secret key seed.
Sourcepub fn signing_key(&self) -> &SigningKey
pub fn signing_key(&self) -> &SigningKey
Returns the underlying Ed25519 signing key.
Sourcepub fn verifying_key(&self) -> VerifyingKey
pub fn verifying_key(&self) -> VerifyingKey
Returns the corresponding Ed25519 verifying key.
Sourcepub fn public_key_bytes(&self) -> [u8; 32]
pub fn public_key_bytes(&self) -> [u8; 32]
Returns the public verifying key bytes.
Sourcepub fn save_to_file(&self, path: &Path) -> Result<(), CryptoError>
pub fn save_to_file(&self, path: &Path) -> Result<(), CryptoError>
Writes the secret key seed to path.
Sourcepub fn load_from_file(path: &Path) -> Result<Self, CryptoError>
pub fn load_from_file(path: &Path) -> Result<Self, CryptoError>
Loads a keypair from a file containing exactly 32 secret-key bytes.
Auto Trait Implementations§
impl Freeze for KeyPair
impl RefUnwindSafe for KeyPair
impl Send for KeyPair
impl Sync for KeyPair
impl Unpin for KeyPair
impl UnsafeUnpin for KeyPair
impl UnwindSafe for KeyPair
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