pub struct Keypair<C>where
C: PrimeCurve + CurveArithmetic,
Scalar<C>: Invert<Output = CtOption<Scalar<C>>> + SignPrimitive<C>,
SignatureSize<C>: ArrayLength<u8>,{ /* private fields */ }Expand description
A keypair for signing messages.
Implementations§
Source§impl<C> Keypair<C>where
C: PrimeCurve + CurveArithmetic,
Scalar<C>: Invert<Output = CtOption<Scalar<C>>> + SignPrimitive<C>,
SignatureSize<C>: ArrayLength<u8>,
impl<C> Keypair<C>where
C: PrimeCurve + CurveArithmetic,
Scalar<C>: Invert<Output = CtOption<Scalar<C>>> + SignPrimitive<C>,
SignatureSize<C>: ArrayLength<u8>,
Sourcepub fn create(rng: &mut impl CryptoRngCore) -> Self
pub fn create(rng: &mut impl CryptoRngCore) -> Self
Generate a cryptographically random SigningKey.
use atrium_crypto::keypair::Keypair;
let keypair = Keypair::<k256::Secp256k1>::create(&mut rand::thread_rng());Source§impl<C> Keypair<C>where
C: PrimeCurve + CurveArithmetic + DigestPrimitive,
Scalar<C>: Invert<Output = CtOption<Scalar<C>>> + SignPrimitive<C>,
SignatureSize<C>: ArrayLength<u8>,
impl<C> Keypair<C>where
C: PrimeCurve + CurveArithmetic + DigestPrimitive,
Scalar<C>: Invert<Output = CtOption<Scalar<C>>> + SignPrimitive<C>,
SignatureSize<C>: ArrayLength<u8>,
Trait Implementations§
Source§impl<C> Export<C> for Keypair<C>where
C: PrimeCurve + CurveArithmetic,
Scalar<C>: Invert<Output = CtOption<Scalar<C>>> + SignPrimitive<C>,
SignatureSize<C>: ArrayLength<u8>,
impl<C> Export<C> for Keypair<C>where
C: PrimeCurve + CurveArithmetic,
Scalar<C>: Invert<Output = CtOption<Scalar<C>>> + SignPrimitive<C>,
SignatureSize<C>: ArrayLength<u8>,
Auto Trait Implementations§
impl<C> Freeze for Keypair<C>where
<<C as Curve>::FieldBytesSize as Add>::Output: Sized,
<C as CurveArithmetic>::Scalar: Sized + Freeze,
<C as CurveArithmetic>::AffinePoint: Freeze,
impl<C> RefUnwindSafe for Keypair<C>where
<<C as Curve>::FieldBytesSize as Add>::Output: Sized,
<C as CurveArithmetic>::Scalar: Sized + RefUnwindSafe,
<C as CurveArithmetic>::AffinePoint: RefUnwindSafe,
impl<C> Send for Keypair<C>
impl<C> Sync for Keypair<C>
impl<C> Unpin for Keypair<C>where
<<C as Curve>::FieldBytesSize as Add>::Output: Sized,
<C as CurveArithmetic>::Scalar: Sized + Unpin,
<C as CurveArithmetic>::AffinePoint: Unpin,
impl<C> UnwindSafe for Keypair<C>where
<<C as Curve>::FieldBytesSize as Add>::Output: Sized,
<C as CurveArithmetic>::Scalar: Sized + UnwindSafe,
<C as CurveArithmetic>::AffinePoint: 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