Struct fluence_identity::key_pair::KeyPair [−][src]
An Ed25519 keypair.
Implementations
impl KeyPair
[src]
pub fn generate() -> Self
[src]
Generate a new Ed25519 keypair.
pub fn public(&self) -> PublicKey
[src]
pub fn secret(&self) -> SecretKey
[src]
pub fn from_bytes(sk_bytes: &[u8]) -> Result<Self, SignatureError>
[src]
pub fn encode(&self) -> [u8; 64]
[src]
Encode the keypair into a byte array by concatenating the bytes of the secret scalar and the compressed public point/
pub fn decode(kp: &[u8]) -> Result<KeyPair, SignatureError>
[src]
Decode a keypair from the format produced by encode
.
pub fn public_key(&self) -> PublicKey
[src]
Get the public key of this keypair.
pub fn sign(&self, msg: &[u8]) -> Signature
[src]
Sign a message using the private key of this keypair.
pub fn verify(
pk: &PublicKey,
msg: &[u8],
signature: &Signature
) -> Result<(), SignatureError>
[src]
pk: &PublicKey,
msg: &[u8],
signature: &Signature
) -> Result<(), SignatureError>
Verify the Ed25519 signature on a message using the public key.
Trait Implementations
impl Clone for KeyPair
[src]
impl Debug for KeyPair
[src]
impl<'de> Deserialize<'de> for KeyPair
[src]
Implement serde::Deserialize for KeyPair
fn deserialize<D>(deserializer: D) -> Result<KeyPair, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl From<Keypair> for KeyPair
[src]
fn from(kp: Libp2pKeyPair) -> Self
[src]
impl From<Keypair> for KeyPair
[src]
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> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
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>,