Struct ring_compat::signature::ed25519::SigningKey
source · pub struct SigningKey { /* private fields */ }
Available on crate feature
signature
only.Expand description
Ed25519 signing key.
Implementations§
source§impl SigningKey
impl SigningKey
sourcepub const SIZE: usize = 32usize
pub const SIZE: usize = 32usize
Size of a raw SigningKey
(a.k.a. seed) in bytes.
sourcepub fn generate(rng: &mut impl CryptoRngCore) -> Self
Available on crate feature rand_core
only.
pub fn generate(rng: &mut impl CryptoRngCore) -> Self
rand_core
only.Generate a random Ed25519 key using the provided RNG.
sourcepub fn from_bytes(seed: &[u8; 32]) -> Self
pub fn from_bytes(seed: &[u8; 32]) -> Self
Create a new SigningKey
from an unexpanded seed value (32-bytes).
sourcepub fn from_slice(seed: &[u8]) -> Result<Self>
pub fn from_slice(seed: &[u8]) -> Result<Self>
Create a new SigningKey
from a byte slice containing a seed value.
sourcepub fn from_seed(seed: &[u8]) -> Result<Self>
👎Deprecated since 0.7.0: use from_slice
instead
pub fn from_seed(seed: &[u8]) -> Result<Self>
from_slice
insteadAlias for from_slice
.
sourcepub fn to_bytes(&self) -> [u8; 32]
pub fn to_bytes(&self) -> [u8; 32]
Serialize this SigningKey
as a 32-byte “seed”.
sourcepub fn verifying_key(&self) -> VerifyingKey
pub fn verifying_key(&self) -> VerifyingKey
Get the VerifyingKey
for this SigningKey
.
Trait Implementations§
source§impl Clone for SigningKey
impl Clone for SigningKey
source§impl EncodePrivateKey for SigningKey
Available on crate features alloc
and pkcs8
only.
impl EncodePrivateKey for SigningKey
Available on crate features
alloc
and pkcs8
only.source§fn to_pkcs8_der(&self) -> Result<SecretDocument>
fn to_pkcs8_der(&self) -> Result<SecretDocument>
Serialize a [
SecretDocument
] containing a PKCS#8-encoded private key.source§impl From<&SigningKey> for KeypairBytes
Available on crate feature pkcs8
only.
impl From<&SigningKey> for KeypairBytes
Available on crate feature
pkcs8
only.source§fn from(signing_key: &SigningKey) -> KeypairBytes
fn from(signing_key: &SigningKey) -> KeypairBytes
Converts to this type from the input type.
source§impl From<&SigningKey> for VerifyingKey
impl From<&SigningKey> for VerifyingKey
source§fn from(signing_key: &SigningKey) -> Self
fn from(signing_key: &SigningKey) -> Self
Converts to this type from the input type.
source§impl From<SigningKey> for KeypairBytes
Available on crate feature pkcs8
only.
impl From<SigningKey> for KeypairBytes
Available on crate feature
pkcs8
only.source§fn from(signing_key: SigningKey) -> KeypairBytes
fn from(signing_key: SigningKey) -> KeypairBytes
Converts to this type from the input type.
source§impl Keypair for SigningKey
impl Keypair for SigningKey
§type VerifyingKey = VerifyingKey
type VerifyingKey = VerifyingKey
Verifying key type for this keypair.
source§fn verifying_key(&self) -> VerifyingKey
fn verifying_key(&self) -> VerifyingKey
Get the verifying key which can verify signatures produced by the
signing key portion of this keypair.
source§impl Signer<Signature> for SigningKey
impl Signer<Signature> for SigningKey
source§impl TryFrom<&[u8]> for SigningKey
impl TryFrom<&[u8]> for SigningKey
source§impl TryFrom<&KeypairBytes> for SigningKey
Available on crate feature pkcs8
only.
impl TryFrom<&KeypairBytes> for SigningKey
Available on crate feature
pkcs8
only.source§impl TryFrom<KeypairBytes> for SigningKey
Available on crate feature pkcs8
only.
impl TryFrom<KeypairBytes> for SigningKey
Available on crate feature
pkcs8
only.source§impl TryFrom<PrivateKeyInfo<'_>> for SigningKey
Available on crate feature pkcs8
only.
impl TryFrom<PrivateKeyInfo<'_>> for SigningKey
Available on crate feature
pkcs8
only.Auto Trait Implementations§
impl RefUnwindSafe for SigningKey
impl Send for SigningKey
impl Sync for SigningKey
impl Unpin for SigningKey
impl UnwindSafe for SigningKey
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