pub struct Ed25519PrivateKey(/* private fields */);Expand description
An Ed25519 private key.
Implementations§
Source§impl Ed25519PrivateKey
impl Ed25519PrivateKey
Sourcepub fn new_using(rng: &mut impl RandomNumberGenerator) -> Self
pub fn new_using(rng: &mut impl RandomNumberGenerator) -> Self
Creates a new random Ed25519 private key using the given random number generator.
Sourcepub const fn from_data(data: [u8; 32]) -> Self
pub const fn from_data(data: [u8; 32]) -> Self
Restores an Ed25519 private key from an array of bytes.
Sourcepub fn from_data_ref(data: impl AsRef<[u8]>) -> Result<Self>
pub fn from_data_ref(data: impl AsRef<[u8]>) -> Result<Self>
Restores an Ed25519 private key from a reference to an array of bytes.
Sourcepub fn derive_from_key_material(key_material: impl AsRef<[u8]>) -> Self
pub fn derive_from_key_material(key_material: impl AsRef<[u8]>) -> Self
Derives a new SigningPrivateKey from the given key material.
pub fn hex(&self) -> String
pub fn from_hex(hex: impl AsRef<str>) -> Result<Self>
Source§impl Ed25519PrivateKey
impl Ed25519PrivateKey
Sourcepub fn public_key(&self) -> Ed25519PublicKey
pub fn public_key(&self) -> Ed25519PublicKey
Derives the public key from this Ed25519 private key.
pub fn sign(&self, message: impl AsRef<[u8]>) -> [u8; 64]
Trait Implementations§
Source§impl AsRef<[u8]> for Ed25519PrivateKey
impl AsRef<[u8]> for Ed25519PrivateKey
Source§impl Clone for Ed25519PrivateKey
impl Clone for Ed25519PrivateKey
Source§fn clone(&self) -> Ed25519PrivateKey
fn clone(&self) -> Ed25519PrivateKey
Returns a copy 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 moreSource§impl Debug for Ed25519PrivateKey
impl Debug for Ed25519PrivateKey
Source§impl Default for Ed25519PrivateKey
impl Default for Ed25519PrivateKey
Source§impl Display for Ed25519PrivateKey
impl Display for Ed25519PrivateKey
Source§impl<'a> From<&'a Ed25519PrivateKey> for &'a [u8]
impl<'a> From<&'a Ed25519PrivateKey> for &'a [u8]
Source§fn from(value: &'a Ed25519PrivateKey) -> Self
fn from(value: &'a Ed25519PrivateKey) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a Ed25519PrivateKey> for &'a [u8; 32]
impl<'a> From<&'a Ed25519PrivateKey> for &'a [u8; 32]
Source§fn from(value: &'a Ed25519PrivateKey) -> Self
fn from(value: &'a Ed25519PrivateKey) -> Self
Converts to this type from the input type.
Source§impl Hash for Ed25519PrivateKey
impl Hash for Ed25519PrivateKey
Source§impl PartialEq for Ed25519PrivateKey
impl PartialEq for Ed25519PrivateKey
impl Eq for Ed25519PrivateKey
impl StructuralPartialEq for Ed25519PrivateKey
Auto Trait Implementations§
impl Freeze for Ed25519PrivateKey
impl RefUnwindSafe for Ed25519PrivateKey
impl Send for Ed25519PrivateKey
impl Sync for Ed25519PrivateKey
impl Unpin for Ed25519PrivateKey
impl UnwindSafe for Ed25519PrivateKey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Upper case
letters are used (e.g. F9B4CA)