pub struct PrivateKey(/* private fields */);Expand description
Represents a private key.
The private key allows creating designated verifier signatures. These signatures require the private key of that verifier to be validated. Furthermore, the verifier can use their private key to forge valid signatures which designate them.
Implementations§
Source§impl PrivateKey
impl PrivateKey
Sourcepub fn from_bytes(data: [u8; 32]) -> Option<Self>
pub fn from_bytes(data: [u8; 32]) -> Option<Self>
Attempt to unmarshall bytes into a private key.
This can fail if the bytes don’t represent a valid private key.
Sourcepub fn sign<R: RngCore + CryptoRng>(
&self,
rng: &mut R,
designee: &PublicKey,
message: &[u8],
) -> Signature
pub fn sign<R: RngCore + CryptoRng>( &self, rng: &mut R, designee: &PublicKey, message: &[u8], ) -> Signature
Sign a message, designated to a specific verifier.
Trait Implementations§
Source§impl Clone for PrivateKey
impl Clone for PrivateKey
Source§fn clone(&self) -> PrivateKey
fn clone(&self) -> PrivateKey
Returns a duplicate 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 PartialEq for PrivateKey
impl PartialEq for PrivateKey
impl Copy for PrivateKey
impl StructuralPartialEq for PrivateKey
Auto Trait Implementations§
impl Freeze for PrivateKey
impl RefUnwindSafe for PrivateKey
impl Send for PrivateKey
impl Sync for PrivateKey
impl Unpin for PrivateKey
impl UnwindSafe for PrivateKey
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