#[non_exhaustive]pub enum VerifyingKey {
Ed25519(Box<VerifyingKey>),
P256(Box<VerifyingKey<NistP256>>),
}Expand description
A public key that can verify.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Ed25519(Box<VerifyingKey>)
An Ed25519 verifying key.
P256(Box<VerifyingKey<NistP256>>)
A P-256 verifying key.
Implementations§
Source§impl VerifyingKey
impl VerifyingKey
Sourcepub fn to_raw_bytes(&self) -> Vec<u8> ⓘ
pub fn to_raw_bytes(&self) -> Vec<u8> ⓘ
The raw public key bytes: the 32-byte Ed25519 point, or the 65-byte uncompressed SEC1 encoding of a P-256 point.
The two are different lengths and neither is self-describing, so
VerifyingKey::from_raw_bytes has to be told which algorithm it is
reading. Prefer a Jwk anywhere the algorithm has to
travel with the key.
Sourcepub fn from_raw_bytes(
algorithm: Algorithm,
bytes: &[u8],
) -> Result<VerifyingKey, JoseError>
pub fn from_raw_bytes( algorithm: Algorithm, bytes: &[u8], ) -> Result<VerifyingKey, JoseError>
Parses raw public key bytes for algorithm.
§Errors
Returns JoseError::InvalidKey if the bytes are the wrong length for
the algorithm, or are not a valid point.
Trait Implementations§
Source§impl Clone for VerifyingKey
impl Clone for VerifyingKey
Source§fn clone(&self) -> VerifyingKey
fn clone(&self) -> VerifyingKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 VerifyingKey
impl Debug for VerifyingKey
impl Eq for VerifyingKey
Source§impl PartialEq for VerifyingKey
impl PartialEq for VerifyingKey
impl StructuralPartialEq for VerifyingKey
Auto Trait Implementations§
impl Freeze for VerifyingKey
impl RefUnwindSafe for VerifyingKey
impl Send for VerifyingKey
impl Sync for VerifyingKey
impl Unpin for VerifyingKey
impl UnsafeUnpin for VerifyingKey
impl UnwindSafe for VerifyingKey
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