#[non_exhaustive]pub enum KeyType {
Ed25519,
X25519,
P256,
P384,
P521,
Secp256k1,
Unknown,
}Expand description
Known cryptographic key types.
This enum is #[non_exhaustive]: new algorithms (hybrid schemes, future
NIST standards, vendor-specific key types) will be added in minor
releases without breaking match-all arms.
No Default impl is provided on purpose: a key without a known
algorithm is a programming error in this crate, not a sensible
default state. KeyType::Unknown exists for parsing paths that
receive an unrecognised curve or codec identifier.
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
X25519
P256
P384
P521
Secp256k1
Unknown
Unrecognised or unsupported key type. Produced by parsing paths on unknown curve identifiers; should never be constructed directly.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for KeyType
impl<'de> Deserialize<'de> for KeyType
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<KeyType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<KeyType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for KeyType
impl Serialize for KeyType
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for KeyType
impl Eq for KeyType
impl StructuralPartialEq for KeyType
Auto Trait Implementations§
impl Freeze for KeyType
impl RefUnwindSafe for KeyType
impl Send for KeyType
impl Sync for KeyType
impl Unpin for KeyType
impl UnsafeUnpin for KeyType
impl UnwindSafe for KeyType
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