Struct ed25519_dalek::pkcs8::PublicKeyBytes
source · pub struct PublicKeyBytes(pub [u8; 32]);
Available on crate feature
pkcs8
only.Expand description
Ed25519 public key serialized as bytes.
This type is primarily useful for decoding/encoding SPKI public key files (either DER or PEM) encoded using the following traits:
DecodePublicKey
: decode DER or PEM encoded PKCS#8 private key.EncodePublicKey
: encode DER or PEM encoded PKCS#8 private key.
SPKI public key files encoded with PEM begin with:
-----BEGIN PUBLIC KEY-----
Note that this type operates on raw bytes and performs no validation that public keys represent valid compressed Ed25519 y-coordinates.
Tuple Fields§
§0: [u8; 32]
Implementations§
Trait Implementations§
source§impl Clone for PublicKeyBytes
impl Clone for PublicKeyBytes
source§fn clone(&self) -> PublicKeyBytes
fn clone(&self) -> PublicKeyBytes
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 PublicKeyBytes
impl Debug for PublicKeyBytes
source§impl DecodePublicKey for PublicKeyBytes
impl DecodePublicKey for PublicKeyBytes
§fn from_public_key_der(bytes: &[u8]) -> Result<Self, Error>
fn from_public_key_der(bytes: &[u8]) -> Result<Self, Error>
Deserialize object from ASN.1 DER-encoded
SubjectPublicKeyInfo
(binary format).source§impl EncodePublicKey for PublicKeyBytes
Available on crate feature alloc
only.
impl EncodePublicKey for PublicKeyBytes
Available on crate feature
alloc
only.source§impl From<&VerifyingKey> for PublicKeyBytes
impl From<&VerifyingKey> for PublicKeyBytes
source§fn from(verifying_key: &VerifyingKey) -> PublicKeyBytes
fn from(verifying_key: &VerifyingKey) -> PublicKeyBytes
Converts to this type from the input type.
source§impl From<VerifyingKey> for PublicKeyBytes
impl From<VerifyingKey> for PublicKeyBytes
source§fn from(verifying_key: VerifyingKey) -> PublicKeyBytes
fn from(verifying_key: VerifyingKey) -> PublicKeyBytes
Converts to this type from the input type.
source§impl PartialEq<PublicKeyBytes> for PublicKeyBytes
impl PartialEq<PublicKeyBytes> for PublicKeyBytes
source§fn eq(&self, other: &PublicKeyBytes) -> bool
fn eq(&self, other: &PublicKeyBytes) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl TryFrom<&[u8]> for PublicKeyBytes
impl TryFrom<&[u8]> for PublicKeyBytes
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<&PublicKeyBytes> for VerifyingKey
impl TryFrom<&PublicKeyBytes> for VerifyingKey
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<PublicKeyBytes> for VerifyingKey
impl TryFrom<PublicKeyBytes> for VerifyingKey
source§impl TryFrom<SubjectPublicKeyInfo<'_>> for PublicKeyBytes
impl TryFrom<SubjectPublicKeyInfo<'_>> for PublicKeyBytes
source§fn try_from(spki: SubjectPublicKeyInfo<'_>) -> Result<PublicKeyBytes, Error>
fn try_from(spki: SubjectPublicKeyInfo<'_>) -> Result<PublicKeyBytes, Error>
Performs the conversion.