aboutsummaryrefslogtreecommitdiff
path: root/openssl/src/crypto/rsa.rs
diff options
context:
space:
mode:
Diffstat (limited to 'openssl/src/crypto/rsa.rs')
-rw-r--r--openssl/src/crypto/rsa.rs6
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