Enum fluence_identity::key_pair::KeyPair [−][src]
Variants
An Ed25519 keypair.
An RSA keypair.
A Secp256k1 keypair.
Implementations
impl KeyPair
[src]
pub fn generate(format: KeyFormat) -> KeyPair
[src]
pub fn generate_ed25519() -> KeyPair
[src]
Generate a new Ed25519 keypair.
pub fn generate_secp256k1() -> KeyPair
[src]
Generate a new Secp256k1 keypair.
pub fn rsa_from_pkcs8(pkcs8_der: &mut [u8]) -> Result<KeyPair, DecodingError>
[src]
Decode an keypair from a DER-encoded secret key in PKCS#8 PrivateKeyInfo format (i.e. unencrypted) as defined in RFC5208.
pub fn secp256k1_from_der(der: &mut [u8]) -> Result<KeyPair, DecodingError>
[src]
Decode a keypair from a DER-encoded Secp256k1 secret key in an ECPrivateKey structure as defined in RFC5915.
pub fn sign(&self, msg: &[u8]) -> Result<Signature, SigningError>
[src]
Sign a message using the private key of this keypair, producing a signature that can be verified using the corresponding public key.
pub fn public(&self) -> PublicKey
[src]
Get the public key of this keypair.
pub fn verify(
pk: &PublicKey,
msg: &[u8],
signature: &Signature
) -> Result<(), SigningError>
[src]
pk: &PublicKey,
msg: &[u8],
signature: &Signature
) -> Result<(), SigningError>
Verify the signature on a message using the public key.
pub fn to_vec(&self) -> Vec<u8>
[src]
pub fn from_vec(
bytes: Vec<u8>,
format: KeyFormat
) -> Result<Self, DecodingError>
[src]
bytes: Vec<u8>,
format: KeyFormat
) -> Result<Self, DecodingError>
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for KeyPair
impl Send for KeyPair
impl Sync for KeyPair
impl Unpin for KeyPair
impl UnwindSafe for KeyPair
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,