Struct ed25519::pkcs8::PublicKeyBytes
source · 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).§fn from_public_key_pem(s: &str) -> Result<Self, Error>
fn from_public_key_pem(s: &str) -> Result<Self, Error>
Deserialize PEM-encoded [
SubjectPublicKeyInfo
]. Read moresource§impl EncodePublicKey for PublicKeyBytes
Available on crate feature alloc
only.
impl EncodePublicKey for PublicKeyBytes
Available on crate feature
alloc
only.source§fn to_public_key_der(&self) -> Result<Document>
fn to_public_key_der(&self) -> Result<Document>
Serialize a
Document
containing a SPKI-encoded public key.§fn to_public_key_pem(&self, line_ending: LineEnding) -> Result<String, Error>
fn to_public_key_pem(&self, line_ending: LineEnding) -> Result<String, Error>
Serialize this public key as PEM-encoded SPKI with the given [
LineEnding
].source§impl FromStr for PublicKeyBytes
Available on crate feature pem
only.
impl FromStr for PublicKeyBytes
Available on crate feature
pem
only.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 ToString for PublicKeyBytes
Available on crate feature pem
only.
impl ToString for PublicKeyBytes
Available on crate feature
pem
only.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>
fn try_from(keypair: &KeypairBytes) -> Result<PublicKeyBytes>
Performs the conversion.
source§impl TryFrom<KeypairBytes> for PublicKeyBytes
impl TryFrom<KeypairBytes> for PublicKeyBytes
source§fn try_from(keypair: KeypairBytes) -> Result<PublicKeyBytes>
fn try_from(keypair: KeypairBytes) -> Result<PublicKeyBytes>
Performs the conversion.