Skip to main content

SigningKey

Struct SigningKey 

Source
pub struct SigningKey<P: Parameters> { /* private fields */ }
Expand description

Signing key generic over the parameters

Implementations§

Source§

impl<P> SigningKey<P>
where P: Parameters,

Source

pub fn random() -> Result<(Self, VerificationKey<P>), Error>

Sample a new random signing key and the corresponding verification key. This operation may fail if the Picnic library is not built with support for the given parameter set.

Trait Implementations§

Source§

impl<P> AsRef<[u8]> for SigningKey<P>
where P: Parameters,

Source§

fn as_ref(&self) -> &[u8] ⓘ

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<P: Clone + Parameters> Clone for SigningKey<P>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<P> ConstantTimeEq for SigningKey<P>
where P: Parameters,

Available on crate feature subtle only.
Source§

fn ct_eq(&self, other: &Self) -> Choice

Determine if two items are equal. Read more
Source§

fn ct_ne(&self, other: &Self) -> Choice

Determine if two items are NOT equal. Read more
Source§

impl<P> Debug for SigningKey<P>
where P: Parameters,

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, P> Deserialize<'de> for SigningKey<P>
where P: Parameters,

Available on crate feature serialization only.
Source§

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<P: Parameters> Drop for SigningKey<P>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl<P> Eq for SigningKey<P>
where P: Parameters,

Source§

impl<P> PartialEq for SigningKey<P>
where P: Parameters,

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<P> Serialize for SigningKey<P>
where P: Parameters,

Available on crate feature serialization only.
Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<P> Signer<DynamicSignature> for SigningKey<P>
where P: Parameters,

Source§

fn try_sign(&self, msg: &[u8]) -> Result<DynamicSignature, Error>

Attempt to sign the given message, returning a digital signature on success, or an error if something went wrong. Read more
Source§

fn sign(&self, msg: &[u8]) -> S

Sign the given message and return a digital signature.
Source§

impl<P> TryFrom<&SigningKey<P>> for VerificationKey<P>
where P: Parameters,

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(sk: &SigningKey<P>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<P> TryFrom<&[u8]> for SigningKey<P>
where P: Parameters,

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(value: &[u8]) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<P> Verifier<DynamicSignature> for SigningKey<P>
where P: Parameters,

Source§

fn verify(&self, msg: &[u8], signature: &DynamicSignature) -> Result<(), Error>

Use Self (e.g. a verifying key) to verify that the provided signature is authentic for a given message bytestring. Read more
Source§

impl<P: Parameters> Zeroize for SigningKey<P>

Source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.

Auto Trait Implementations§

§

impl<P> Forget for SigningKey<P>

§

impl<P> Freeze for SigningKey<P>
where PhantomData<P>: Freeze,

§

impl<P> Move for SigningKey<P>

§

impl<P> RefUnwindSafe for SigningKey<P>

§

impl<P> Send for SigningKey<P>
where PhantomData<P>: Send,

§

impl<P> Sync for SigningKey<P>
where PhantomData<P>: Sync,

§

impl<P> Unpin for SigningKey<P>
where PhantomData<P>: Unpin,

§

impl<P> UnsafeUnpin for SigningKey<P>

§

impl<P> UnwindSafe for SigningKey<P>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<S, T> AsyncSigner<S> for T
where T: Signer<S>,

Source§

async fn sign_async(&self, msg: &[u8]) -> Result<S, Error>

Attempt to sign the given message, returning a digital signature on success, or an error if something went wrong. Read more
Source§

impl<S, T> AsyncVerifier<S> for T
where T: Verifier<S>,

Source§

async fn verify_async(&self, msg: &[u8], signature: &S) -> Result<(), Error>

Asynchronously verify that the provided signature for a given message bytestring is authentic. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.