pub struct SecretKey { /* private fields */ }Expand description
Secret key for EdDSA (Ed25519) signature verification over Curve25519.
Implementations§
Source§impl SecretKey
impl SecretKey
Sourcepub fn new() -> SecretKey
pub fn new() -> SecretKey
Generates a new random secret key using the OS random number generator.
Sourcepub fn public_key(&self) -> PublicKey
pub fn public_key(&self) -> PublicKey
Gets the corresponding public key for this secret key.
Computes a Diffie-Hellman shared secret from this secret key and the ephemeral public key generated by the other party.
Trait Implementations§
Source§impl Deserializable for SecretKey
impl Deserializable for SecretKey
Source§fn read_from<R>(source: &mut R) -> Result<SecretKey, DeserializationError>where
R: ByteReader,
fn read_from<R>(source: &mut R) -> Result<SecretKey, DeserializationError>where
R: ByteReader,
Reads a sequence of bytes from the provided
source, attempts to deserialize these bytes
into Self, and returns the result. Read moreSource§fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
Source§impl Serializable for SecretKey
impl Serializable for SecretKey
Source§fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
Serializes
self into bytes and writes these bytes into the target.Source§fn get_size_hint(&self) -> usize
fn get_size_hint(&self) -> usize
Returns an estimate of how many bytes are needed to represent self. Read more
impl Eq for SecretKey
impl ZeroizeOnDrop for SecretKey
Auto Trait Implementations§
impl Freeze for SecretKey
impl RefUnwindSafe for SecretKey
impl Send for SecretKey
impl Sync for SecretKey
impl Unpin for SecretKey
impl UnwindSafe for SecretKey
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