pub enum AnyPrivateKey {
Ed25519(Ed25519PrivateKey),
Secp256k1(Secp256k1PrivateKey),
Secp256r1(Secp256r1PrivateKey),
}Expand description
A private key that can be any supported signature scheme.
Variants§
Ed25519(Ed25519PrivateKey)
Available on crate feature
ed25519 only.Ed25519 private key.
Secp256k1(Secp256k1PrivateKey)
Available on crate feature
secp256k1 only.Secp256k1 private key.
Secp256r1(Secp256r1PrivateKey)
Available on crate feature
secp256r1 only.Secp256r1 private key.
Implementations§
Source§impl AnyPrivateKey
impl AnyPrivateKey
Sourcepub fn variant(&self) -> AnyPublicKeyVariant
pub fn variant(&self) -> AnyPublicKeyVariant
Gets the signature scheme variant.
Sourcepub fn public_key(&self) -> AnyPublicKey
pub fn public_key(&self) -> AnyPublicKey
Gets the public key.
Sourcepub fn sign(&self, message: &[u8]) -> AnySignature
pub fn sign(&self, message: &[u8]) -> AnySignature
Signs a message.
Sourcepub fn ed25519(key: Ed25519PrivateKey) -> Self
Available on crate feature ed25519 only.
pub fn ed25519(key: Ed25519PrivateKey) -> Self
ed25519 only.Creates an Ed25519 private key.
Sourcepub fn secp256k1(key: Secp256k1PrivateKey) -> Self
Available on crate feature secp256k1 only.
pub fn secp256k1(key: Secp256k1PrivateKey) -> Self
secp256k1 only.Creates a Secp256k1 private key.
Sourcepub fn secp256r1(key: Secp256r1PrivateKey) -> Self
Available on crate feature secp256r1 only.
pub fn secp256r1(key: Secp256r1PrivateKey) -> Self
secp256r1 only.Creates a Secp256r1 private key.
Trait Implementations§
Source§impl Clone for AnyPrivateKey
impl Clone for AnyPrivateKey
Auto Trait Implementations§
impl Freeze for AnyPrivateKey
impl RefUnwindSafe for AnyPrivateKey
impl Send for AnyPrivateKey
impl Sync for AnyPrivateKey
impl Unpin for AnyPrivateKey
impl UnwindSafe for AnyPrivateKey
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