Struct blind_rsa_signatures::SecretKey [−][src]
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]
&self,
blind_msg: impl AsRef<[u8]>
) -> Result<BlindSignature, Error>
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]ⓘ
[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]
&self,
padding: PaddingScheme,
ciphertext: &[u8]
) -> Result<Vec<u8, Global>, Error>
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]
&self,
rng: &mut R,
padding: PaddingScheme,
ciphertext: &[u8]
) -> Result<Vec<u8, Global>, Error> where
R: Rng,
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]
&self,
padding: PaddingScheme,
digest_in: &[u8]
) -> Result<Vec<u8, Global>, Error>
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]
&self,
rng: &mut R,
padding: PaddingScheme,
digest_in: &[u8]
) -> Result<Vec<u8, Global>, Error> where
R: Rng,
Sign the given digest.
Use rng
for blinding.
Methods from Deref<Target = RSAPublicKey>
Trait Implementations
impl AsRef<RSAPrivateKey> for SecretKey
[src]
fn as_ref(&self) -> &RSAPrivateKey
[src]
impl Clone for SecretKey
[src]
impl Debug for SecretKey
[src]
impl Deref for SecretKey
[src]
type Target = RSAPrivateKey
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
impl From<RSAPrivateKey> for SecretKey
[src]
fn from(original: RSAPrivateKey) -> SecretKey
[src]
impl From<SecretKey> for RSAPrivateKey
[src]
fn from(original: SecretKey) -> RSAPrivateKey
[src]
Auto Trait Implementations
impl RefUnwindSafe for SecretKey
impl Send for SecretKey
impl Sync for SecretKey
impl Unpin for SecretKey
impl UnwindSafe for SecretKey
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,