pub struct PublicKeyBytes(pub [u8; 57]);Expand description
Ed448 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 Ed448 y-coordinates.
Tuple Fields§
§0: [u8; 57]Implementations§
Trait Implementations§
Source§impl Clone for PublicKeyBytes
impl Clone for PublicKeyBytes
Source§fn clone(&self) -> PublicKeyBytes
fn clone(&self) -> PublicKeyBytes
Returns a duplicate 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 EncodePublicKey for PublicKeyBytes
Available on crate feature alloc only.
impl EncodePublicKey for PublicKeyBytes
Available on crate feature
alloc only.Source§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. Read moreSource§fn write_public_key_der_file(&self, path: impl AsRef<Path>) -> Result<(), Error>
fn write_public_key_der_file(&self, path: impl AsRef<Path>) -> Result<(), Error>
Write ASN.1 DER-encoded public key to the given path. Read more
Source§fn write_public_key_pem_file(
&self,
path: impl AsRef<Path>,
line_ending: LineEnding,
) -> Result<(), Error>
fn write_public_key_pem_file( &self, path: impl AsRef<Path>, line_ending: LineEnding, ) -> Result<(), Error>
Write ASN.1 PEM-encoded public key to the given path. Read more
Source§impl From<VerifyingKey> for PublicKeyBytes
Available on crate feature pkcs8 only.
impl From<VerifyingKey> for PublicKeyBytes
Available on crate feature
pkcs8 only.Source§fn from(key: VerifyingKey) -> Self
fn from(key: VerifyingKey) -> Self
Converts to this type from the input type.
Source§impl Hash for PublicKeyBytes
impl Hash for PublicKeyBytes
Source§impl PartialEq for PublicKeyBytes
impl PartialEq for PublicKeyBytes
Source§impl TryFrom<&PublicKeyBytes> for VerifyingKey
Available on crate feature pkcs8 only.
impl TryFrom<&PublicKeyBytes> for VerifyingKey
Available on crate feature
pkcs8 only.Source§impl TryFrom<PublicKeyBytes> for VerifyingKey
Available on crate feature pkcs8 only.
impl TryFrom<PublicKeyBytes> for VerifyingKey
Available on crate feature
pkcs8 only.Source§impl TryFrom<SubjectPublicKeyInfo<AnyRef<'_>, BitStringRef<'_>>> for PublicKeyBytes
impl TryFrom<SubjectPublicKeyInfo<AnyRef<'_>, BitStringRef<'_>>> for PublicKeyBytes
Source§fn try_from(
spki: SubjectPublicKeyInfo<AnyRef<'_>, BitStringRef<'_>>,
) -> Result<PublicKeyBytes, Error>
fn try_from( spki: SubjectPublicKeyInfo<AnyRef<'_>, BitStringRef<'_>>, ) -> Result<PublicKeyBytes, Error>
Performs the conversion.
impl Copy for PublicKeyBytes
impl Eq for PublicKeyBytes
impl StructuralPartialEq for PublicKeyBytes
Auto Trait Implementations§
impl Freeze for PublicKeyBytes
impl RefUnwindSafe for PublicKeyBytes
impl Send for PublicKeyBytes
impl Sync for PublicKeyBytes
impl Unpin for PublicKeyBytes
impl UnsafeUnpin for PublicKeyBytes
impl UnwindSafe for PublicKeyBytes
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DecodePublicKey for T
impl<T> DecodePublicKey for T
Source§fn from_public_key_der(bytes: &[u8]) -> Result<T, Error>
fn from_public_key_der(bytes: &[u8]) -> Result<T, Error>
Deserialize object from ASN.1 DER-encoded [
SubjectPublicKeyInfo]
(binary format). Read moreSource§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 more