pub struct Ed25519SigningKey { /* private fields */ }Expand description
An Ed25519 key pair capable of producing signatures.
Implementations§
Source§impl Ed25519SigningKey
impl Ed25519SigningKey
Sourcepub fn generate() -> Result<Self, Error>
pub fn generate() -> Result<Self, Error>
Generates a fresh Ed25519 key pair using the system RNG.
§Errors
Returns Error::KeyGeneration if the underlying RNG fails, which
effectively only happens on platforms where aws-lc-rs cannot
initialise a secure random source.
Sourcepub fn from_pkcs8_der(der: &[u8]) -> Result<Self, Error>
pub fn from_pkcs8_der(der: &[u8]) -> Result<Self, Error>
Loads an Ed25519 key pair from a PKCS#8 DER blob.
§Errors
Returns Error::InvalidPkcs8 if the DER cannot be decoded as an
Ed25519 PrivateKeyInfo.
Sourcepub fn to_pkcs8_der(&self) -> &[u8] ⓘ
pub fn to_pkcs8_der(&self) -> &[u8] ⓘ
Returns the PKCS#8 v2 DER encoding of the private key.
Sourcepub fn public_key(&self) -> Ed25519PublicKey
pub fn public_key(&self) -> Ed25519PublicKey
Returns the corresponding public key.
§Panics
Panics only if aws-lc-rs produces a public key whose length is
not exactly 32 bytes — which the Ed25519 algorithm forbids by
construction. A panic here therefore indicates a bug in
aws-lc-rs and not in our code.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Ed25519SigningKey
impl RefUnwindSafe for Ed25519SigningKey
impl Send for Ed25519SigningKey
impl Sync for Ed25519SigningKey
impl Unpin for Ed25519SigningKey
impl UnsafeUnpin for Ed25519SigningKey
impl UnwindSafe for Ed25519SigningKey
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