pub struct Ed25519Keypair {
pub public: Ed25519PublicKey,
pub private: Ed25519PrivateKey,
}
Expand description
Ed25519 private/public keypair.
Fields§
§public: Ed25519PublicKey
Public key.
private: Ed25519PrivateKey
Private key.
Implementations§
source§impl Ed25519Keypair
impl Ed25519Keypair
sourcepub fn random(rng: &mut impl CryptoRngCore) -> Self
Available on crate feature ed25519
only.
pub fn random(rng: &mut impl CryptoRngCore) -> Self
ed25519
only.Generate a random Ed25519 private keypair.
sourcepub fn from_seed(seed: &[u8; 32]) -> Self
Available on crate feature ed25519
only.
pub fn from_seed(seed: &[u8; 32]) -> Self
ed25519
only.Expand a keypair from a 32-byte seed value.
sourcepub fn from_bytes(bytes: &[u8; 64]) -> Result<Self>
pub fn from_bytes(bytes: &[u8; 64]) -> Result<Self>
Parse Ed25519 keypair from 64-bytes which comprise the serialized private and public keys.
Trait Implementations§
source§impl Clone for Ed25519Keypair
impl Clone for Ed25519Keypair
source§fn clone(&self) -> Ed25519Keypair
fn clone(&self) -> Ed25519Keypair
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 ConstantTimeEq for Ed25519Keypair
impl ConstantTimeEq for Ed25519Keypair
source§impl Debug for Ed25519Keypair
impl Debug for Ed25519Keypair
source§impl Decode for Ed25519Keypair
impl Decode for Ed25519Keypair
source§impl Encode for Ed25519Keypair
impl Encode for Ed25519Keypair
source§fn encoded_len(&self) -> Result<usize>
fn encoded_len(&self) -> Result<usize>
Get the length of this type encoded in bytes, prior to Base64 encoding.
source§fn encode(&self, writer: &mut impl Writer) -> Result<()>
fn encode(&self, writer: &mut impl Writer) -> Result<()>
Encode this value using the provided
Writer
.source§fn encoded_len_prefixed(&self) -> Result<usize, Error>
fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a
uint32
length prefix.source§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a
uint32
length prefix
set to Encode::encoded_len
.source§impl From<&Ed25519Keypair> for Ed25519PublicKey
impl From<&Ed25519Keypair> for Ed25519PublicKey
source§fn from(keypair: &Ed25519Keypair) -> Ed25519PublicKey
fn from(keypair: &Ed25519Keypair) -> Ed25519PublicKey
Converts to this type from the input type.
source§impl From<&SigningKey> for Ed25519Keypair
Available on crate feature ed25519
only.
impl From<&SigningKey> for Ed25519Keypair
Available on crate feature
ed25519
only.source§fn from(key: &SigningKey) -> Ed25519Keypair
fn from(key: &SigningKey) -> Ed25519Keypair
Converts to this type from the input type.
source§impl From<Ed25519Keypair> for Ed25519PublicKey
impl From<Ed25519Keypair> for Ed25519PublicKey
source§fn from(keypair: Ed25519Keypair) -> Ed25519PublicKey
fn from(keypair: Ed25519Keypair) -> Ed25519PublicKey
Converts to this type from the input type.
source§impl From<Ed25519Keypair> for KeypairData
impl From<Ed25519Keypair> for KeypairData
source§fn from(keypair: Ed25519Keypair) -> KeypairData
fn from(keypair: Ed25519Keypair) -> KeypairData
Converts to this type from the input type.
source§impl From<Ed25519Keypair> for PrivateKey
impl From<Ed25519Keypair> for PrivateKey
source§fn from(keypair: Ed25519Keypair) -> PrivateKey
fn from(keypair: Ed25519Keypair) -> PrivateKey
Converts to this type from the input type.
source§impl From<Ed25519PrivateKey> for Ed25519Keypair
Available on crate feature ed25519
only.
impl From<Ed25519PrivateKey> for Ed25519Keypair
Available on crate feature
ed25519
only.source§fn from(private: Ed25519PrivateKey) -> Ed25519Keypair
fn from(private: Ed25519PrivateKey) -> Ed25519Keypair
Converts to this type from the input type.
source§impl From<SigningKey> for Ed25519Keypair
Available on crate feature ed25519
only.
impl From<SigningKey> for Ed25519Keypair
Available on crate feature
ed25519
only.source§fn from(key: SigningKey) -> Ed25519Keypair
fn from(key: SigningKey) -> Ed25519Keypair
Converts to this type from the input type.
source§impl PartialEq for Ed25519Keypair
impl PartialEq for Ed25519Keypair
source§impl Signer<Signature> for Ed25519Keypair
Available on crate features alloc
and ed25519
only.
impl Signer<Signature> for Ed25519Keypair
Available on crate features
alloc
and ed25519
only.source§impl TryFrom<&[u8]> for Ed25519Keypair
impl TryFrom<&[u8]> for Ed25519Keypair
source§impl TryFrom<&Ed25519Keypair> for SigningKey
Available on crate feature ed25519
only.
impl TryFrom<&Ed25519Keypair> for SigningKey
Available on crate feature
ed25519
only.source§fn try_from(key: &Ed25519Keypair) -> Result<SigningKey>
fn try_from(key: &Ed25519Keypair) -> Result<SigningKey>
Performs the conversion.
source§impl TryFrom<Ed25519Keypair> for SigningKey
Available on crate feature ed25519
only.
impl TryFrom<Ed25519Keypair> for SigningKey
Available on crate feature
ed25519
only.source§fn try_from(key: Ed25519Keypair) -> Result<SigningKey>
fn try_from(key: Ed25519Keypair) -> Result<SigningKey>
Performs the conversion.
impl Eq for Ed25519Keypair
Auto Trait Implementations§
impl Freeze for Ed25519Keypair
impl RefUnwindSafe for Ed25519Keypair
impl Send for Ed25519Keypair
impl Sync for Ed25519Keypair
impl Unpin for Ed25519Keypair
impl UnwindSafe for Ed25519Keypair
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)