pub enum KeyPairAlgorithm {
Ed25519,
}Expand description
Key pair types supported by the system
Variants§
Ed25519
Ed25519 elliptic curve signature scheme
Implementations§
Source§impl KeyPairAlgorithm
impl KeyPairAlgorithm
Sourcepub fn generate_keypair(&self) -> Result<KeyPair, CryptoError>
pub fn generate_keypair(&self) -> Result<KeyPair, CryptoError>
Generate a new key pair for this algorithm
This is a convenience method that creates a new random key pair of the specified algorithm type.
§Example
use ave_identity::keys::KeyPairAlgorithm;
let algorithm = KeyPairAlgorithm::Ed25519;
let keypair = algorithm.generate_keypair().unwrap();Trait Implementations§
Source§impl Clone for KeyPairAlgorithm
impl Clone for KeyPairAlgorithm
Source§fn clone(&self) -> KeyPairAlgorithm
fn clone(&self) -> KeyPairAlgorithm
Returns a duplicate of the value. Read more
1.0.0 · 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 KeyPairAlgorithm
impl Debug for KeyPairAlgorithm
Source§impl Default for KeyPairAlgorithm
impl Default for KeyPairAlgorithm
Source§fn default() -> KeyPairAlgorithm
fn default() -> KeyPairAlgorithm
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for KeyPairAlgorithm
impl<'de> Deserialize<'de> for KeyPairAlgorithm
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 Display for KeyPairAlgorithm
impl Display for KeyPairAlgorithm
Source§impl From<DSAlgorithm> for KeyPairAlgorithm
impl From<DSAlgorithm> for KeyPairAlgorithm
Source§fn from(algo: DSAlgorithm) -> Self
fn from(algo: DSAlgorithm) -> Self
Converts to this type from the input type.
Source§impl From<KeyPairAlgorithm> for DSAlgorithm
impl From<KeyPairAlgorithm> for DSAlgorithm
Source§fn from(kp_type: KeyPairAlgorithm) -> Self
fn from(kp_type: KeyPairAlgorithm) -> Self
Converts to this type from the input type.
Source§impl PartialEq for KeyPairAlgorithm
impl PartialEq for KeyPairAlgorithm
Source§impl Serialize for KeyPairAlgorithm
impl Serialize for KeyPairAlgorithm
impl Copy for KeyPairAlgorithm
impl Eq for KeyPairAlgorithm
impl StructuralPartialEq for KeyPairAlgorithm
Auto Trait Implementations§
impl Freeze for KeyPairAlgorithm
impl RefUnwindSafe for KeyPairAlgorithm
impl Send for KeyPairAlgorithm
impl Sync for KeyPairAlgorithm
impl Unpin for KeyPairAlgorithm
impl UnsafeUnpin for KeyPairAlgorithm
impl UnwindSafe for KeyPairAlgorithm
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