pub enum SecretKey {
EcdsaP384Sha384(SecretKey<NistP384>),
EcdsaP256Sha256(SecretKey<NistP256>),
Ed25519(SecretKey),
}Expand description
Secret key for http signature Name conventions follow Section-6.2.2, RFC9421
Variants§
EcdsaP384Sha384(SecretKey<NistP384>)
ecdsa-p384-sha384
EcdsaP256Sha256(SecretKey<NistP256>)
ecdsa-p256-sha256
Ed25519(SecretKey)
ed25519
Implementations§
Source§impl SecretKey
impl SecretKey
Sourcepub fn from_bytes(
alg: AlgorithmName,
bytes: &[u8],
) -> Result<SecretKey, HttpSigError>
pub fn from_bytes( alg: AlgorithmName, bytes: &[u8], ) -> Result<SecretKey, HttpSigError>
from plain bytes
Sourcepub fn from_der(der: &[u8]) -> Result<SecretKey, HttpSigError>
pub fn from_der(der: &[u8]) -> Result<SecretKey, HttpSigError>
parse der Derive secret key from der bytes
Sourcepub fn from_pem(pem: &str) -> Result<SecretKey, HttpSigError>
pub fn from_pem(pem: &str) -> Result<SecretKey, HttpSigError>
Derive secret key from pem string
Sourcepub fn public_key(&self) -> PublicKey
pub fn public_key(&self) -> PublicKey
Get public key from secret key
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SecretKey
impl RefUnwindSafe for SecretKey
impl Send for SecretKey
impl Sync for SecretKey
impl Unpin for SecretKey
impl UnwindSafe for SecretKey
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