Struct recrypt::api::SigningKeypair [−]
pub struct SigningKeypair { /* fields omitted */ }
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
impl SigningKeypair
pub fn new<CR: RngCore + CryptoRng>(rng: &mut CR) -> SigningKeypair
pub fn new<CR: RngCore + CryptoRng>(rng: &mut CR) -> SigningKeypair
pub fn from_byte_slice(bytes: &[u8]) -> Result<SigningKeypair, Ed25519Error>
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>
pub fn from_bytes(
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
pub fn public_key(&self) -> PublicSigningKey
Get the public_key portion of this SigningKeypair.
pub fn bytes(&self) -> [u8; 64]
pub fn bytes(&self) -> [u8; 64]
Export the bytes of the keypair.
pub fn sign<A: Hashable>(&self, message: &A) -> Ed25519Signature
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 Debug for SigningKeypair
impl Debug for SigningKeypair
fn fmt(&self, formatter: &mut Formatter) -> Result
fn fmt(&self, formatter: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for SigningKeypair
impl PartialEq for SigningKeypair
fn eq(&self, other: &SigningKeypair) -> bool
fn eq(&self, other: &SigningKeypair) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl Eq for SigningKeypair
impl Eq for SigningKeypair
impl<'a> From<&'a SigningKeypair> for PublicSigningKey
impl<'a> From<&'a SigningKeypair> for PublicSigningKey
fn from(kp: &SigningKeypair) -> PublicSigningKey
fn from(kp: &SigningKeypair) -> PublicSigningKey
Performs the conversion.
impl Drop for SigningKeypair
impl Drop for SigningKeypair
Auto Trait Implementations
impl Send for SigningKeypair
impl Send for SigningKeypair
impl Sync for SigningKeypair
impl Sync for SigningKeypair