pub struct PublicKey { /* private fields */ }Expand description
A structure containing information about a public key.
Implementations§
Source§impl PublicKey
impl PublicKey
Sourcepub fn from_spki(der_bytes: &[u8], scheme: SignatureScheme) -> Result<Self>
pub fn from_spki(der_bytes: &[u8], scheme: SignatureScheme) -> Result<Self>
Parse DER bytes as an SPKI key.
See the documentation on KeyValue for more information on SPKI.
Sourcepub fn from_ed25519<T: Into<Vec<u8>>>(bytes: T) -> Result<Self>
pub fn from_ed25519<T: Into<Vec<u8>>>(bytes: T) -> Result<Self>
Parse ED25519 bytes as a public key.
Sourcepub fn from_ed25519_with_keyid_hash_algorithms<T: Into<Vec<u8>>>(
bytes: T,
keyid_hash_algorithms: Option<Vec<String>>,
) -> Result<Self>
pub fn from_ed25519_with_keyid_hash_algorithms<T: Into<Vec<u8>>>( bytes: T, keyid_hash_algorithms: Option<Vec<String>>, ) -> Result<Self>
Parse ED25519 bytes as a public key with a custom keyid_hash_algorithms.
Sourcepub fn as_spki(&self) -> Result<Vec<u8>>
pub fn as_spki(&self) -> Result<Vec<u8>>
Write the public key as SPKI DER bytes.
See the documentation on KeyValue for more information on SPKI.
Sourcepub fn scheme(&self) -> &SignatureScheme
pub fn scheme(&self) -> &SignatureScheme
An immutable referece to the key’s authorized signing scheme.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PublicKey
impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<D: Deserializer<'de>>(de: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(de: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for PublicKey
impl Ord for PublicKey
Source§impl PartialOrd for PublicKey
impl PartialOrd for PublicKey
impl Eq for PublicKey
Auto Trait Implementations§
impl Freeze for PublicKey
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnsafeUnpin for PublicKey
impl UnwindSafe for PublicKey
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