pub struct EcdsaKeyVerifier<K, A>{ /* private fields */ }Available on crate feature
ring only.Expand description
Wrapper for ::ring::signature::UnparsedPublicKey.
§Examples
§ES256 PKCS8
let public_key =
"-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEerEk+zqoG1oYBLD3ohuz0tzIlU7X
zFG1098HcCOu0CmVAsp8ZLYXqYD3ts6+j0CV/I2yfzwx/ojBrm+Z/pSQnA==
-----END PUBLIC KEY-----";
// Convert the PKCS8 PEM to SPK.
// Note that ring requires SPK (not SPKI) keys for ECDSA_P256_SHA256 public keys.
// See https://github.com/briansmith/ring/issues/881
let public_key = convert_pkcs8_pem_to_spk(public_key);
let public_key = ::ring::signature::UnparsedPublicKey::new(
&::ring::signature::ECDSA_P256_SHA256_FIXED,
public_key,
);
let verifier = min_jwt::verify::ring::EcdsaKeyVerifier::with_es256(&public_key);
let verified_jwt = min_jwt::verify(jwt, &verifier)?;
let header = verified_jwt.decode_header();
let claims = verified_jwt.decode_claims();Implementations§
Source§impl<K, A> EcdsaKeyVerifier<K, A>
impl<K, A> EcdsaKeyVerifier<K, A>
Sourcepub fn into_inner(self) -> K
pub fn into_inner(self) -> K
Returns the inner key.
Source§impl<K> EcdsaKeyVerifier<K, Es256>where
K: EcdsaKey,
impl<K> EcdsaKeyVerifier<K, Es256>where
K: EcdsaKey,
Sourcepub fn with_es256(key: K) -> EcdsaKeyVerifier<K, Es256>
pub fn with_es256(key: K) -> EcdsaKeyVerifier<K, Es256>
Creates a new Es256 key verifier.
Trait Implementations§
Source§impl<K, A> Debug for EcdsaKeyVerifier<K, A>
impl<K, A> Debug for EcdsaKeyVerifier<K, A>
Auto Trait Implementations§
impl<K, A> Freeze for EcdsaKeyVerifier<K, A>where
K: Freeze,
impl<K, A> RefUnwindSafe for EcdsaKeyVerifier<K, A>where
K: RefUnwindSafe,
A: RefUnwindSafe,
impl<K, A> Send for EcdsaKeyVerifier<K, A>
impl<K, A> Sync for EcdsaKeyVerifier<K, A>
impl<K, A> Unpin for EcdsaKeyVerifier<K, A>
impl<K, A> UnwindSafe for EcdsaKeyVerifier<K, A>where
K: UnwindSafe,
A: UnwindSafe,
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