pub enum Key {
Blake3(Blake3Key),
HmacSha256(HmacSha256Key),
HmacSha512(HmacSha512Key),
Ed25519Secret(Ed25519SecretKey),
Ed25519Public(Ed25519PublicKey),
P256Secret(P256SecretKey),
P256Public(P256PublicKey),
RsaPublic(Box<RsaPublicKey>),
}Expand description
A concrete cryptographic key extracted from and that can be converted to a Jwk.
Use Key::try_from(&Jwk) to convert a Jwk (e.g. from a JWKS endpoint)
into a key without knowing the exact key type at compile time. The result
can be passed directly to crate::parse_and_verify or crate::sign.
Use [Key::into](Jwk) to convert a Key into a Jwk.
RsaPublicKeys require heap-allocation to avoid bloating the enum, as RSA should now be deprecated.
Variants§
Blake3(Blake3Key)
HmacSha256(HmacSha256Key)
HmacSha512(HmacSha512Key)
Ed25519Secret(Ed25519SecretKey)
Ed25519Public(Ed25519PublicKey)
P256Secret(P256SecretKey)
P256Public(P256PublicKey)
RsaPublic(Box<RsaPublicKey>)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Key
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnsafeUnpin for Key
impl UnwindSafe for Key
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