diff options
| author | Benjamin Fry <[email protected]> | 2016-02-23 20:49:21 -0800 |
|---|---|---|
| committer | Benjamin Fry <[email protected]> | 2016-02-23 20:49:21 -0800 |
| commit | 6ebe581308af861b440557be5baba2edb354f7b8 (patch) | |
| tree | f2fce3e588bd7b33164c9b04a773026ce4daaa39 /openssl/src/crypto/rsa.rs | |
| parent | adding functionality to directly get and set RSA key material (diff) | |
| download | rust-openssl-6ebe581308af861b440557be5baba2edb354f7b8.tar.xz rust-openssl-6ebe581308af861b440557be5baba2edb354f7b8.zip | |
review fixes, keep raw RSA initiallization private
Diffstat (limited to 'openssl/src/crypto/rsa.rs')
| -rw-r--r-- | openssl/src/crypto/rsa.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/openssl/src/crypto/rsa.rs b/openssl/src/crypto/rsa.rs index 034f8828..80eec7da 100644 --- a/openssl/src/crypto/rsa.rs +++ b/openssl/src/crypto/rsa.rs @@ -7,7 +7,7 @@ use std::io::{self, Read}; use bn::BigNum; use bio::MemBio; -pub struct RSA(pub *mut ffi::RSA); +pub struct RSA(*mut ffi::RSA); impl Drop for RSA { fn drop(&mut self) { @@ -27,6 +27,10 @@ impl RSA { } } + pub fn with_raw(rsa: *mut ffi::RSA) -> RSA { + RSA(rsa) + } + /// Reads an RSA private key from PEM formatted data. pub fn private_key_from_pem<R>(reader: &mut R) -> Result<RSA, SslError> where R: Read |