[−]Struct recrypt::api_480::SigningKeypair
The first 32 bytes of this are the Secret Ed25519 key and the 2nd 32 bytes are the Compressed Y form of the public key.
Methods
impl SigningKeypair
pub fn new<CR: RngCore + CryptoRng>(rng: &Mutex<CR>) -> SigningKeypair
pub fn from_byte_slice(bytes: &[u8]) -> Result<SigningKeypair, Ed25519Error>
Create a SigningKeypair from a byte array slice. If the array is not the right length or if the public key doesn't match the private, it will return an Ed25519Error.
pub fn from_bytes(
sized_bytes: &[u8; 64]
) -> Result<SigningKeypair, Ed25519Error>
sized_bytes: &[u8; 64]
) -> Result<SigningKeypair, Ed25519Error>
Create a SigningKeypair from a sized array of bytes. This can fail if the public key portion doesn't match the private key.
pub fn public_key(&self) -> PublicSigningKey
Get the public_key portion of this SigningKeypair.
pub fn bytes(&self) -> &[u8; 64]
Export the bytes of the keypair.
pub fn sign<A: Hashable>(&self, message: &A) -> Ed25519Signature
Create a signature by signing over the bytes produced by the hashable instance of message
.
Trait Implementations
impl Drop for SigningKeypair
fn drop(&mut self)
impl Clone for SigningKeypair
fn clone(&self) -> SigningKeypair
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl From<SigningKeypair> for [u8; 64]
fn from(t: SigningKeypair) -> Self
impl<'a> From<&'a SigningKeypair> for PublicSigningKey
fn from(kp: &SigningKeypair) -> PublicSigningKey
impl Debug for SigningKeypair
Auto Trait Implementations
impl Send for SigningKeypair
impl Unpin for SigningKeypair
impl Sync for SigningKeypair
impl UnwindSafe for SigningKeypair
impl RefUnwindSafe for SigningKeypair
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for 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.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self