pub struct Unverified { /* private fields */ }
Expand description
The Unverified step of the verification process
This type is the result of performing some basic validation on the parsed header, and can be used to verify the header
Implementations§
Source§impl Unverified
impl Unverified
Sourcepub fn key_id(&self) -> &str
pub fn key_id(&self) -> &str
Get the Key ID from an Unverified type
This is useful for looking up the proper verification key to verify the request
Sourcepub fn algorithm(&self) -> Option<&Algorithm>
pub fn algorithm(&self) -> Option<&Algorithm>
Get the Algorithm used in the request, if one is present
If the algorithm is present and is not what an implementor expected, they should not attempt to verify the signature
Sourcepub fn signing_string(&self) -> &str
pub fn signing_string(&self) -> &str
Get the signing string used to create the signature
Sourcepub fn verify<F, T>(&self, f: F) -> T
pub fn verify<F, T>(&self, f: F) -> T
Verify the signature with the signature and the signing string
ⓘ
unverified.verify(|signature, signing_string| {
let bytes = match base64::decode(signature) {
Ok(bytes) => bytes,
Err(_) => return false,
};
public_key
.verify(bytes, signing_string)
.unwrap_or(false)
})
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Unverified
impl RefUnwindSafe for Unverified
impl Send for Unverified
impl Sync for Unverified
impl Unpin for Unverified
impl UnwindSafe for Unverified
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