pub struct PublicVerificationKey { /* private fields */ }Expand description
A standalone verification key that can be used to verify signatures
Implementations§
Source§impl PublicVerificationKey
impl PublicVerificationKey
Sourcepub async fn verify(&self, payload: &[u8], signature: &[u8]) -> Result<()>
pub async fn verify(&self, payload: &[u8], signature: &[u8]) -> Result<()>
Verify a signature against this key
Sourcepub fn new(kid: String, public_jwk: Value) -> Self
pub fn new(kid: String, public_jwk: Value) -> Self
Create a new PublicVerificationKey from a JWK
Sourcepub fn from_jwk(jwk: &Value, kid: &str, _did: &str) -> Result<Self>
pub fn from_jwk(jwk: &Value, kid: &str, _did: &str) -> Result<Self>
Create a PublicVerificationKey from a JWK
Sourcepub fn from_verification_material(
kid: String,
material: &VerificationMaterial,
) -> Result<Self>
pub fn from_verification_material( kid: String, material: &VerificationMaterial, ) -> Result<Self>
Create a PublicVerificationKey from a VerificationMaterial
Trait Implementations§
Source§impl Clone for PublicVerificationKey
impl Clone for PublicVerificationKey
Source§fn clone(&self) -> PublicVerificationKey
fn clone(&self) -> PublicVerificationKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PublicVerificationKey
impl Debug for PublicVerificationKey
Source§impl VerificationKey for PublicVerificationKey
impl VerificationKey for PublicVerificationKey
Source§fn public_key_jwk(&self) -> Result<Value>
fn public_key_jwk(&self) -> Result<Value>
Exports the public key material as a JWK
Source§fn verify_signature<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
payload: &'life1 [u8],
signature: &'life2 [u8],
protected_header: &'life3 JwsProtected,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn verify_signature<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
payload: &'life1 [u8],
signature: &'life2 [u8],
protected_header: &'life3 JwsProtected,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Verifies the provided signature against the payload and protected header
Auto Trait Implementations§
impl Freeze for PublicVerificationKey
impl RefUnwindSafe for PublicVerificationKey
impl Send for PublicVerificationKey
impl Sync for PublicVerificationKey
impl Unpin for PublicVerificationKey
impl UnwindSafe for PublicVerificationKey
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