Struct did_toolkit::jwk::JWK
source · pub struct JWK(pub JsonWebKey);Expand description
Encapsulation of JSON Web Keys, provided by the jsonwebkey crate underneath. Serialization omits the private key fields deliberately according to DID spec, as it is assumed for these purposes it will be used in a decentralized identity document.
See https://www.w3.org/TR/did-core/#verification-material for more information.
Tuple Fields§
§0: JsonWebKeyImplementations§
source§impl JWK
impl JWK
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new JWK and generates a key for it. The underlying key will have private key material.
sourcepub fn new_from_key(key: Key) -> Self
pub fn new_from_key(key: Key) -> Self
Creates a new JWK struct from an existing jsonwebkey::Key.
sourcepub fn to_public_only(&self) -> Self
pub fn to_public_only(&self) -> Self
Erases the private key material and creates a new struct from the result.
Trait Implementations§
source§impl<'de> Deserialize<'de> for JWK
impl<'de> Deserialize<'de> for JWK
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for JWK
impl Ord for JWK
source§impl PartialOrd<JWK> for JWK
impl PartialOrd<JWK> for JWK
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Eq for JWK
impl StructuralEq for JWK
impl StructuralPartialEq for JWK
Auto Trait Implementations§
impl RefUnwindSafe for JWK
impl Send for JWK
impl Sync for JWK
impl Unpin for JWK
impl UnwindSafe for JWK
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.