pub enum PublicKey {
EcdsaP256Sha256(PublicKey<NistP256>),
EcdsaP384Sha384(PublicKey<NistP384>),
Ed25519(PublicKey),
}Expand description
Public key for http signature, only for asymmetric algorithm Name conventions follow Section 6.2.2, RFC9421
Variants§
EcdsaP256Sha256(PublicKey<NistP256>)
ecdsa-p256-sha256
EcdsaP384Sha384(PublicKey<NistP384>)
ecdsa-p384-sha384
Ed25519(PublicKey)
ed25519
Implementations§
Source§impl PublicKey
impl PublicKey
Sourcepub fn from_bytes(
alg: &AlgorithmName,
bytes: &[u8],
) -> Result<PublicKey, HttpSigError>
pub fn from_bytes( alg: &AlgorithmName, bytes: &[u8], ) -> Result<PublicKey, HttpSigError>
from plain bytes
Sourcepub fn from_pem(
alg: &AlgorithmName,
pem: &str,
) -> Result<PublicKey, HttpSigError>
pub fn from_pem( alg: &AlgorithmName, pem: &str, ) -> Result<PublicKey, HttpSigError>
Convert from pem string
Trait Implementations§
Source§impl VerifyingKey for PublicKey
impl VerifyingKey for PublicKey
Source§fn key_id(&self) -> String
fn key_id(&self) -> String
Create key id, created by SHA-256 hash of the public key bytes, then encoded in base64
- For ECDSA keys, use the uncompressed SEC1 encoding of the public key point as the byte representation.
- For Ed25519 keys, use the raw 32-byte public key.
- For RSA keys, use the DER encoding of the RSAPublicKey structure in PKCS#1 format.
Source§fn alg(&self) -> AlgorithmName
fn alg(&self) -> AlgorithmName
Get the algorithm name
Auto Trait Implementations§
impl Freeze for PublicKey
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin 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