Struct openssl::crypto::rsa::RSA [] [src]

pub struct RSA(_);

Methods

impl RSA
[src]

fn from_public_components(n: BigNum, e: BigNum) -> Result<RSA, ErrorStack>

only useful for associating the key material directly with the key, it's safer to use the supplied load and save methods for DER formatted keys.

fn from_private_components(n: BigNum, e: BigNum, d: BigNum, p: BigNum, q: BigNum, dp: BigNum, dq: BigNum, qi: BigNum) -> Result<RSA, ErrorStack>

unsafe fn from_ptr(rsa: *mut RSA) -> RSA

fn generate(bits: u32) -> Result<RSA, ErrorStack>

Generates a public/private key pair with the specified size.

The public exponent will be 65537.

fn private_key_from_pem(buf: &[u8]) -> Result<RSA, ErrorStack>

Reads an RSA private key from PEM formatted data.

fn private_key_from_pem_cb<F>(buf: &[u8], pass_cb: F) -> Result<RSA, ErrorStack> where F: FnOnce(&mut [c_char]) -> usize

Reads an RSA private key from PEM formatted data and supplies a password callback.

fn public_key_from_pem(buf: &[u8]) -> Result<RSA, ErrorStack>

Reads an RSA public key from PEM formatted data.

fn private_key_to_pem(&self) -> Result<Vec<u8>, ErrorStack>

Writes an RSA private key as unencrypted PEM formatted data

fn public_key_to_pem(&self) -> Result<Vec<u8>, ErrorStack>

Writes an RSA public key as PEM formatted data

fn size(&self) -> Option<u32>

fn sign(&self, hash: Type, message: &[u8]) -> Result<Vec<u8>, ErrorStack>

fn verify(&self, hash: Type, message: &[u8], sig: &[u8]) -> Result<(), ErrorStack>

fn as_ptr(&self) -> *mut RSA

fn n<'a>(&'a self) -> Option<BigNumRef<'a>>

fn d<'a>(&self) -> Option<BigNumRef<'a>>

fn e<'a>(&'a self) -> Option<BigNumRef<'a>>

fn p<'a>(&'a self) -> Option<BigNumRef<'a>>

fn q<'a>(&'a self) -> Option<BigNumRef<'a>>

Trait Implementations

impl Drop for RSA
[src]

fn drop(&mut self)

A method called when the value goes out of scope. Read more

impl Debug for RSA
[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.