Struct dryoc::sign::SigningKeyPair
source · pub struct SigningKeyPair<PublicKey: ByteArray<CRYPTO_SIGN_PUBLICKEYBYTES> + Zeroize, SecretKey: ByteArray<CRYPTO_SIGN_SECRETKEYBYTES> + Zeroize> {
pub public_key: PublicKey,
pub secret_key: SecretKey,
}
Expand description
An Ed25519 keypair for public-key signatures
Fields§
§public_key: PublicKey
Public key
secret_key: SecretKey
Secret key
Implementations§
source§impl SigningKeyPair<Locked<HeapByteArray<CRYPTO_SIGN_PUBLICKEYBYTES>>, Locked<HeapByteArray<CRYPTO_SIGN_SECRETKEYBYTES>>>
impl SigningKeyPair<Locked<HeapByteArray<CRYPTO_SIGN_PUBLICKEYBYTES>>, Locked<HeapByteArray<CRYPTO_SIGN_SECRETKEYBYTES>>>
sourcepub fn new_locked_keypair() -> Result<Self, Error>
Available on crate feature nightly
only.
pub fn new_locked_keypair() -> Result<Self, Error>
nightly
only.Returns a new locked signing keypair.
sourcepub fn gen_locked_keypair() -> Result<Self, Error>
Available on crate feature nightly
only.
pub fn gen_locked_keypair() -> Result<Self, Error>
nightly
only.Returns a new randomly generated locked signing keypair.
source§impl SigningKeyPair<LockedRO<HeapByteArray<CRYPTO_SIGN_PUBLICKEYBYTES>>, LockedRO<HeapByteArray<CRYPTO_SIGN_SECRETKEYBYTES>>>
impl SigningKeyPair<LockedRO<HeapByteArray<CRYPTO_SIGN_PUBLICKEYBYTES>>, LockedRO<HeapByteArray<CRYPTO_SIGN_SECRETKEYBYTES>>>
sourcepub fn gen_readonly_locked_keypair() -> Result<Self, Error>
Available on crate feature nightly
only.
pub fn gen_readonly_locked_keypair() -> Result<Self, Error>
nightly
only.Returns a new randomly generated locked, read-only signing keypair.
source§impl<PublicKey: NewByteArray<CRYPTO_SIGN_PUBLICKEYBYTES> + Zeroize, SecretKey: NewByteArray<CRYPTO_SIGN_SECRETKEYBYTES> + Zeroize> SigningKeyPair<PublicKey, SecretKey>
impl<PublicKey: NewByteArray<CRYPTO_SIGN_PUBLICKEYBYTES> + Zeroize, SecretKey: NewByteArray<CRYPTO_SIGN_SECRETKEYBYTES> + Zeroize> SigningKeyPair<PublicKey, SecretKey>
sourcepub fn from_secret_key(secret_key: SecretKey) -> Self
pub fn from_secret_key(secret_key: SecretKey) -> Self
Derives a signing keypair from secret_key
, and consumes it, returning
a new keypair.
source§impl SigningKeyPair<StackByteArray<CRYPTO_SIGN_PUBLICKEYBYTES>, StackByteArray<CRYPTO_SIGN_SECRETKEYBYTES>>
impl SigningKeyPair<StackByteArray<CRYPTO_SIGN_PUBLICKEYBYTES>, StackByteArray<CRYPTO_SIGN_SECRETKEYBYTES>>
sourcepub fn gen_with_defaults() -> Self
pub fn gen_with_defaults() -> Self
Randomly generates a new signing keypair, using default types (stack-allocated byte arrays). Provided for convenience.
source§impl<'a, PublicKey: ByteArray<CRYPTO_SIGN_PUBLICKEYBYTES> + TryFrom<&'a [u8]> + Zeroize, SecretKey: ByteArray<CRYPTO_SIGN_SECRETKEYBYTES> + TryFrom<&'a [u8]> + Zeroize> SigningKeyPair<PublicKey, SecretKey>
impl<'a, PublicKey: ByteArray<CRYPTO_SIGN_PUBLICKEYBYTES> + TryFrom<&'a [u8]> + Zeroize, SecretKey: ByteArray<CRYPTO_SIGN_SECRETKEYBYTES> + TryFrom<&'a [u8]> + Zeroize> SigningKeyPair<PublicKey, SecretKey>
source§impl<PublicKey: ByteArray<CRYPTO_SIGN_PUBLICKEYBYTES> + Zeroize, SecretKey: ByteArray<CRYPTO_SIGN_SECRETKEYBYTES> + Zeroize> SigningKeyPair<PublicKey, SecretKey>
impl<PublicKey: ByteArray<CRYPTO_SIGN_PUBLICKEYBYTES> + Zeroize, SecretKey: ByteArray<CRYPTO_SIGN_SECRETKEYBYTES> + Zeroize> SigningKeyPair<PublicKey, SecretKey>
sourcepub fn sign<Signature: NewByteArray<CRYPTO_SIGN_BYTES> + Zeroize, Message: Bytes + Zeroize>(
&self,
message: Message
) -> Result<SignedMessage<Signature, Message>, Error>
pub fn sign<Signature: NewByteArray<CRYPTO_SIGN_BYTES> + Zeroize, Message: Bytes + Zeroize>( &self, message: Message ) -> Result<SignedMessage<Signature, Message>, Error>
Signs message
using this keypair, consuming the message, and returning
a new SignedMessage
. The type of message
should match that of the
target signed message.
sourcepub fn sign_with_defaults<Message: Bytes>(
&self,
message: Message
) -> Result<SignedMessage<StackByteArray<CRYPTO_SIGN_BYTES>, Vec<u8>>, Error>
pub fn sign_with_defaults<Message: Bytes>( &self, message: Message ) -> Result<SignedMessage<StackByteArray<CRYPTO_SIGN_BYTES>, Vec<u8>>, Error>
Signs message
, putting the result into a Vec
. Convenience wrapper
for SigningKeyPair::sign
.
Trait Implementations§
source§impl<PublicKey: Clone + ByteArray<CRYPTO_SIGN_PUBLICKEYBYTES> + Zeroize, SecretKey: Clone + ByteArray<CRYPTO_SIGN_SECRETKEYBYTES> + Zeroize> Clone for SigningKeyPair<PublicKey, SecretKey>
impl<PublicKey: Clone + ByteArray<CRYPTO_SIGN_PUBLICKEYBYTES> + Zeroize, SecretKey: Clone + ByteArray<CRYPTO_SIGN_SECRETKEYBYTES> + Zeroize> Clone for SigningKeyPair<PublicKey, SecretKey>
source§fn clone(&self) -> SigningKeyPair<PublicKey, SecretKey>
fn clone(&self) -> SigningKeyPair<PublicKey, SecretKey>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<PublicKey: Debug + ByteArray<CRYPTO_SIGN_PUBLICKEYBYTES> + Zeroize, SecretKey: Debug + ByteArray<CRYPTO_SIGN_SECRETKEYBYTES> + Zeroize> Debug for SigningKeyPair<PublicKey, SecretKey>
impl<PublicKey: Debug + ByteArray<CRYPTO_SIGN_PUBLICKEYBYTES> + Zeroize, SecretKey: Debug + ByteArray<CRYPTO_SIGN_SECRETKEYBYTES> + Zeroize> Debug for SigningKeyPair<PublicKey, SecretKey>
source§impl<'de, PublicKey, SecretKey> Deserialize<'de> for SigningKeyPair<PublicKey, SecretKey>where
PublicKey: Deserialize<'de> + ByteArray<CRYPTO_SIGN_PUBLICKEYBYTES> + Zeroize,
SecretKey: Deserialize<'de> + ByteArray<CRYPTO_SIGN_SECRETKEYBYTES> + Zeroize,
impl<'de, PublicKey, SecretKey> Deserialize<'de> for SigningKeyPair<PublicKey, SecretKey>where
PublicKey: Deserialize<'de> + ByteArray<CRYPTO_SIGN_PUBLICKEYBYTES> + Zeroize,
SecretKey: Deserialize<'de> + ByteArray<CRYPTO_SIGN_SECRETKEYBYTES> + Zeroize,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<PublicKey: ByteArray<CRYPTO_SIGN_PUBLICKEYBYTES> + Zeroize, SecretKey: ByteArray<CRYPTO_SIGN_SECRETKEYBYTES> + Zeroize> Drop for SigningKeyPair<PublicKey, SecretKey>
impl<PublicKey: ByteArray<CRYPTO_SIGN_PUBLICKEYBYTES> + Zeroize, SecretKey: ByteArray<CRYPTO_SIGN_SECRETKEYBYTES> + Zeroize> Drop for SigningKeyPair<PublicKey, SecretKey>
source§impl<PublicKey: ByteArray<CRYPTO_SIGN_PUBLICKEYBYTES> + Zeroize, SecretKey: ByteArray<CRYPTO_SIGN_SECRETKEYBYTES> + Zeroize> PartialEq for SigningKeyPair<PublicKey, SecretKey>
impl<PublicKey: ByteArray<CRYPTO_SIGN_PUBLICKEYBYTES> + Zeroize, SecretKey: ByteArray<CRYPTO_SIGN_SECRETKEYBYTES> + Zeroize> PartialEq for SigningKeyPair<PublicKey, SecretKey>
source§impl<PublicKey, SecretKey> Serialize for SigningKeyPair<PublicKey, SecretKey>
impl<PublicKey, SecretKey> Serialize for SigningKeyPair<PublicKey, SecretKey>
source§impl<PublicKey, SecretKey> Zeroize for SigningKeyPair<PublicKey, SecretKey>
impl<PublicKey, SecretKey> Zeroize for SigningKeyPair<PublicKey, SecretKey>
Auto Trait Implementations§
impl<PublicKey, SecretKey> RefUnwindSafe for SigningKeyPair<PublicKey, SecretKey>where
PublicKey: RefUnwindSafe,
SecretKey: RefUnwindSafe,
impl<PublicKey, SecretKey> Send for SigningKeyPair<PublicKey, SecretKey>
impl<PublicKey, SecretKey> Sync for SigningKeyPair<PublicKey, SecretKey>
impl<PublicKey, SecretKey> Unpin for SigningKeyPair<PublicKey, SecretKey>
impl<PublicKey, SecretKey> UnwindSafe for SigningKeyPair<PublicKey, SecretKey>where
PublicKey: UnwindSafe,
SecretKey: UnwindSafe,
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