Struct blind_rsa_signatures::SecretKey[][src]

pub struct SecretKey(pub RSAPrivateKey);

An RSA secret key

Implementations

impl SecretKey[src]

pub fn new(f0: RSAPrivateKey) -> Self[src]

Constructs a new SecretKey.

impl SecretKey[src]

pub fn to_der(&self) -> Result<Vec<u8>, Error>[src]

pub fn from_der(der: &[u8]) -> Result<Self, Error>[src]

pub fn to_pem(&self) -> Result<String, Error>[src]

pub fn from_pem(pem: &str) -> Result<Self, Error>[src]

pub fn public_key(&self) -> Result<PublicKey, Error>[src]

pub fn blind_sign(
    &self,
    blind_msg: impl AsRef<[u8]>
) -> Result<BlindSignature, Error>
[src]

Sign a blinded message

Methods from Deref<Target = RSAPrivateKey>

pub fn to_public_key(&self) -> RSAPublicKey[src]

Get the public key from the private key, cloning n and e.

Generally this is not needed since RSAPrivateKey implements the PublicKey trait, but it can occationally be useful to discard the private information entirely.

pub fn d(&self) -> &BigUint[src]

Returns the private exponent of the key.

pub fn primes(&self) -> &[BigUint]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Returns the prime factors.

pub fn validate(&self) -> Result<(), Error>[src]

Performs basic sanity checks on the key. Returns Ok(()) if everything is good, otherwise an approriate error.

pub fn decrypt(
    &self,
    padding: PaddingScheme,
    ciphertext: &[u8]
) -> Result<Vec<u8, Global>, Error>
[src]

Decrypt the given message.

pub fn decrypt_blinded<R>(
    &self,
    rng: &mut R,
    padding: PaddingScheme,
    ciphertext: &[u8]
) -> Result<Vec<u8, Global>, Error> where
    R: Rng
[src]

Decrypt the given message.

Uses rng to blind the decryption process.

pub fn sign(
    &self,
    padding: PaddingScheme,
    digest_in: &[u8]
) -> Result<Vec<u8, Global>, Error>
[src]

Sign the given digest.

pub fn sign_blinded<R>(
    &self,
    rng: &mut R,
    padding: PaddingScheme,
    digest_in: &[u8]
) -> Result<Vec<u8, Global>, Error> where
    R: Rng
[src]

Sign the given digest.

Use rng for blinding.

Methods from Deref<Target = RSAPublicKey>

Trait Implementations

impl AsRef<RSAPrivateKey> for SecretKey[src]

impl Clone for SecretKey[src]

impl Debug for SecretKey[src]

impl Deref for SecretKey[src]

type Target = RSAPrivateKey

The resulting type after dereferencing.

impl From<RSAPrivateKey> for SecretKey[src]

impl From<SecretKey> for RSAPrivateKey[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,