#[non_exhaustive]pub enum Identifier {
Did(Did),
JwkThumbprint(String),
}Expand description
The identifier of an Identity for one kind and algorithm; Display gives
the iss or sub value.
§Examples
use identity_kit::did::Did;
use identity_kit::identity::Identifier;
let did = Identifier::Did(Did::parse("did:example:123")?);
assert_eq!(did.to_string(), "did:example:123");
assert!(did.as_did().is_some());
// RFC 7638 §3.1.
let thumbprint = Identifier::JwkThumbprint("NzbLsXh8uDCcd-6MNwXF4W_7noWXFZAfHkxZsRGC9Xs".into());
assert_eq!(thumbprint.to_string(), "NzbLsXh8uDCcd-6MNwXF4W_7noWXFZAfHkxZsRGC9Xs");
assert!(thumbprint.as_did().is_none());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.
Did(Did)
A DID.
JwkThumbprint(String)
The RFC 7638 SHA-256 thumbprint of the public key, base64url without padding.
Implementations§
Trait Implementations§
Source§impl Clone for Identifier
impl Clone for Identifier
Source§impl Debug for Identifier
impl Debug for Identifier
Source§impl Display for Identifier
impl Display for Identifier
impl Eq for Identifier
Source§impl Hash for Identifier
impl Hash for Identifier
Source§impl PartialEq for Identifier
impl PartialEq for Identifier
impl StructuralPartialEq for Identifier
Auto Trait Implementations§
impl Freeze for Identifier
impl RefUnwindSafe for Identifier
impl Send for Identifier
impl Sync for Identifier
impl Unpin for Identifier
impl UnsafeUnpin for Identifier
impl UnwindSafe for Identifier
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.