Struct ed25519_dalek::pkcs8::KeypairBytes
source · pub struct KeypairBytes {
pub secret_key: [u8; 32],
pub public_key: Option<PublicKeyBytes>,
}
Available on crate feature
pkcs8
only.Expand description
Ed25519 keypair serialized as bytes.
This type is primarily useful for decoding/encoding PKCS#8 private key files (either DER or PEM) encoded using the following traits:
DecodePrivateKey
: decode DER or PEM encoded PKCS#8 private key.EncodePrivateKey
: encode DER or PEM encoded PKCS#8 private key.
PKCS#8 private key files encoded with PEM begin with:
-----BEGIN PRIVATE KEY-----
Note that this type operates on raw bytes and performs no validation that keys represent valid Ed25519 field elements.
Fields§
§secret_key: [u8; 32]
Ed25519 secret key.
Little endian serialization of an element of the Curve25519 scalar field, prior to “clamping” (i.e. setting/clearing bits to ensure the scalar is actually a valid field element)
public_key: Option<PublicKeyBytes>
Ed25519 public key (if available).
Compressed Edwards-y encoded curve point.
Implementations§
source§impl KeypairBytes
impl KeypairBytes
Trait Implementations§
source§impl Debug for KeypairBytes
impl Debug for KeypairBytes
source§impl DecodePrivateKey for KeypairBytes
impl DecodePrivateKey for KeypairBytes
source§impl Drop for KeypairBytes
impl Drop for KeypairBytes
source§impl EncodePrivateKey for KeypairBytes
Available on crate feature alloc
only.
impl EncodePrivateKey for KeypairBytes
Available on crate feature
alloc
only.source§fn to_pkcs8_der(&self) -> Result<SecretDocument, Error>
fn to_pkcs8_der(&self) -> Result<SecretDocument, Error>
Serialize a
SecretDocument
containing a PKCS#8-encoded private key.source§impl From<&SigningKey> for KeypairBytes
impl From<&SigningKey> for KeypairBytes
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 KeypairBytes
impl From<SigningKey> for KeypairBytes
source§fn from(signing_key: SigningKey) -> KeypairBytes
fn from(signing_key: SigningKey) -> KeypairBytes
Converts to this type from the input type.
source§impl TryFrom<&[u8]> for KeypairBytes
impl TryFrom<&[u8]> for KeypairBytes
source§impl TryFrom<&KeypairBytes> for PublicKeyBytes
impl TryFrom<&KeypairBytes> for PublicKeyBytes
source§fn try_from(keypair: &KeypairBytes) -> Result<PublicKeyBytes, Error>
fn try_from(keypair: &KeypairBytes) -> Result<PublicKeyBytes, Error>
Performs the conversion.
source§impl TryFrom<&KeypairBytes> for SigningKey
impl TryFrom<&KeypairBytes> for SigningKey
source§impl TryFrom<KeypairBytes> for PublicKeyBytes
impl TryFrom<KeypairBytes> for PublicKeyBytes
source§fn try_from(keypair: KeypairBytes) -> Result<PublicKeyBytes, Error>
fn try_from(keypair: KeypairBytes) -> Result<PublicKeyBytes, Error>
Performs the conversion.
source§impl TryFrom<KeypairBytes> for SigningKey
impl TryFrom<KeypairBytes> for SigningKey
source§impl TryFrom<PrivateKeyInfo<'_>> for KeypairBytes
impl TryFrom<PrivateKeyInfo<'_>> for KeypairBytes
source§fn try_from(private_key: PrivateKeyInfo<'_>) -> Result<KeypairBytes, Error>
fn try_from(private_key: PrivateKeyInfo<'_>) -> Result<KeypairBytes, Error>
Performs the conversion.