#[non_exhaustive]pub enum Pkcs11Token {
Label(String),
Slot(u64),
}Available on crate feature
pkcs11 only.Expand description
Which token of a PKCS#11 module a Pkcs11KeyStore uses.
&str, String and u64 convert into it.
§Examples
use identity_kit::keys::Pkcs11Token;
assert_eq!(Pkcs11Token::from("issuer"), Pkcs11Token::Label("issuer".to_owned()));
assert_eq!(Pkcs11Token::from(2_108_653_770), Pkcs11Token::Slot(2_108_653_770));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.
Label(String)
The token whose label (CK_TOKEN_INFO.label, as set when the token was initialized)
is this string. Trailing blanks are ignored on both sides.
Slot(u64)
The token in the slot with this id. Slot ids are assigned by the module; SoftHSM2 assigns a new one whenever a token is initialized, so a label is usually the better choice.
Trait Implementations§
Source§impl Clone for Pkcs11Token
impl Clone for Pkcs11Token
Source§impl Debug for Pkcs11Token
impl Debug for Pkcs11Token
Source§impl Display for Pkcs11Token
impl Display for Pkcs11Token
impl Eq for Pkcs11Token
Source§impl From<&str> for Pkcs11Token
impl From<&str> for Pkcs11Token
Source§impl From<String> for Pkcs11Token
impl From<String> for Pkcs11Token
Source§impl From<u64> for Pkcs11Token
impl From<u64> for Pkcs11Token
Source§impl Hash for Pkcs11Token
impl Hash for Pkcs11Token
Source§impl PartialEq for Pkcs11Token
impl PartialEq for Pkcs11Token
impl StructuralPartialEq for Pkcs11Token
Auto Trait Implementations§
impl Freeze for Pkcs11Token
impl RefUnwindSafe for Pkcs11Token
impl Send for Pkcs11Token
impl Sync for Pkcs11Token
impl Unpin for Pkcs11Token
impl UnsafeUnpin for Pkcs11Token
impl UnwindSafe for Pkcs11Token
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.