Struct yubihsm::ecdsa::Signer

source ·
pub struct Signer<C>where
    C: CurveAlgorithm + CurveArithmetic + PointCompression + PrimeCurve,
    FieldBytesSize<C>: ModulusSize,{ /* private fields */ }
Expand description

ECDSA signature provider for yubihsm-client

Implementations§

source§

impl<C> Signer<C>where C: CurveAlgorithm + CurveArithmetic + PointCompression + PrimeCurve, AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>, FieldBytesSize<C>: ModulusSize,

source

pub fn create(client: Client, signing_key_id: Id) -> Result<Self, Error>

Create a new YubiHSM-backed ECDSA signer

source

pub fn public_key(&self) -> &EncodedPoint<C>

Get the public key for the YubiHSM-backed private key.

Trait Implementations§

source§

impl<C> AsRef<VerifyingKey<C>> for Signer<C>where C: CurveAlgorithm + CurveArithmetic + PointCompression + PrimeCurve, FieldBytesSize<C>: ModulusSize,

source§

fn as_ref(&self) -> &VerifyingKey<C>

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

impl<D> DigestSigner<D, (Signature<Secp256k1>, RecoveryId)> for Signer<Secp256k1>where D: Digest<OutputSize = U32> + Default,

Available on crate feature secp256k1 only.
source§

fn try_sign_digest( &self, digest: D ) -> Result<(Signature<Secp256k1>, RecoveryId), Error>

Compute a fixed-size secp256k1 ECDSA signature of the given digest along with the recovery ID.

source§

fn sign_digest(&self, digest: D) -> S

Sign the given prehashed message Digest, returning a signature. Read more
source§

impl<D> DigestSigner<D, Signature<NistP256>> for Signer<NistP256>where D: Digest<OutputSize = U32> + Default,

source§

fn try_sign_digest(&self, digest: D) -> Result<Signature<NistP256>, Error>

Compute a fixed-sized P-256 ECDSA signature of the given digest

source§

fn sign_digest(&self, digest: D) -> S

Sign the given prehashed message Digest, returning a signature. Read more
source§

impl<D> DigestSigner<D, Signature<NistP384>> for Signer<NistP384>where D: Digest<OutputSize = U32> + Default,

source§

fn try_sign_digest(&self, digest: D) -> Result<Signature<NistP384>, Error>

Compute a fixed-sized P-384 ECDSA signature of the given digest

source§

fn sign_digest(&self, digest: D) -> S

Sign the given prehashed message Digest, returning a signature. Read more
source§

impl<D> DigestSigner<D, Signature<Secp256k1>> for Signer<Secp256k1>where D: Digest<OutputSize = U32> + Default,

Available on crate feature secp256k1 only.
source§

fn try_sign_digest(&self, digest: D) -> Result<Signature<Secp256k1>, Error>

Compute a fixed-size secp256k1 ECDSA signature of the given digest

source§

fn sign_digest(&self, digest: D) -> S

Sign the given prehashed message Digest, returning a signature. Read more
source§

impl<C> From<&Signer<C>> for EncodedPoint<C>where Self: Clone, C: CurveAlgorithm + CurveArithmetic + PointCompression + PrimeCurve, AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>, FieldBytesSize<C>: ModulusSize,

source§

fn from(signer: &Signer<C>) -> EncodedPoint<C>

Converts to this type from the input type.
source§

impl<C> KeypairRef for Signer<C>where C: CurveAlgorithm + CurveArithmetic + PointCompression + PrimeCurve, FieldBytesSize<C>: ModulusSize, SignatureSize<C>: ArrayLength<u8>,

§

type VerifyingKey = VerifyingKey<C>

Verifying key type for this keypair.
source§

impl PrehashSigner<(Signature<Secp256k1>, RecoveryId)> for Signer<Secp256k1>

Available on crate feature secp256k1 only.
source§

fn sign_prehash( &self, prehash: &[u8] ) -> Result<(Signature<Secp256k1>, RecoveryId), Error>

Compute a fixed-size secp256k1 ECDSA signature of a digest output along with the recovery ID.

source§

impl PrehashSigner<Signature<NistP256>> for Signer<NistP256>

source§

fn sign_prehash(&self, prehash: &[u8]) -> Result<Signature<NistP256>, Error>

Compute a fixed-size P-256 ECDSA signature of a digest output.

source§

impl PrehashSigner<Signature<NistP384>> for Signer<NistP384>

source§

fn sign_prehash(&self, prehash: &[u8]) -> Result<Signature<NistP384>, Error>

Compute a fixed-size P-384 ECDSA signature of a digest output.

source§

impl PrehashSigner<Signature<Secp256k1>> for Signer<Secp256k1>

Available on crate feature secp256k1 only.
source§

fn sign_prehash(&self, prehash: &[u8]) -> Result<Signature<Secp256k1>, Error>

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

impl<C, __S> Signer<__S> for Signer<C>where C: CurveAlgorithm + CurveArithmetic + PointCompression + PrimeCurve, FieldBytesSize<C>: ModulusSize, __S: PrehashSignature, Self: DigestSigner<__S::Digest, __S>,

source§

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

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

Auto Trait Implementations§

§

impl<C> !RefUnwindSafe for Signer<C>

§

impl<C> Send for Signer<C>

§

impl<C> Sync for Signer<C>

§

impl<C> Unpin for Signer<C>where <C as CurveArithmetic>::AffinePoint: Unpin, <<<C as Curve>::FieldBytesSize as ModulusSize>::UncompressedPointSize as ArrayLength<u8>>::ArrayType: Unpin,

§

impl<C> !UnwindSafe for Signer<C>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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<K> Keypair for Kwhere K: KeypairRef,

§

type VerifyingKey = <K as KeypairRef>::VerifyingKey

Verifying key type for this keypair.
source§

fn verifying_key(&self) -> <K as Keypair>::VerifyingKey

Get the verifying key which can verify signatures produced by the signing key portion of this keypair.
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<S, T> SignerMut<S> for Twhere T: Signer<S>,

source§

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

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

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

Sign the given message, update the state, and return a digital signature.
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.