[][src]Struct ring::signature::RSASigningState

pub struct RSASigningState { /* fields omitted */ }

State used for RSA Signing. Feature: rsa_signing.

Methods

impl SigningState[src]

pub fn new(key_pair: Arc<KeyPair>) -> Result<Self, Unspecified>[src]

Construct a signing state appropriate for use with the given key pair.

pub fn key_pair(&self) -> &KeyPair[src]

The key pair. This can be used, for example, to access the key pair's public key.

pub fn sign(
    &mut self,
    padding_alg: &'static dyn RSAEncoding,
    rng: &dyn SecureRandom,
    msg: &[u8],
    signature: &mut [u8]
) -> Result<(), Unspecified>
[src]

Sign msg. msg is digested using the digest algorithm from padding_alg and the digest is then padded using the padding algorithm from padding_alg. The signature it written into signature; signature's length must be exactly the length returned by public_modulus_len(). rng may be used to randomize the padding (e.g. for PSS).

Many other crypto libraries have signing functions that takes a precomputed digest as input, instead of the message to digest. This function does not take a precomputed digest; instead, sign calculates the digest itself.

Lots of effort has been made to make the signing operations close to constant time to protect the private key from side channel attacks. On x86-64, this is done pretty well, but not perfectly. On other platforms, it is done less perfectly.

Auto Trait Implementations

Blanket Implementations

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]