aboutsummaryrefslogtreecommitdiff
path: root/openssl/src/pkey.rs
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2016-11-13 18:00:42 +0000
committerSteven Fackler <[email protected]>2016-11-13 18:00:42 +0000
commit7dbef567e6cec78adb1d7ec55735935ca7de20fd (patch)
treedc168002d2e5100caf22fbde01bc120e81cc5101 /openssl/src/pkey.rs
parentMacroise from_pem (diff)
downloadrust-openssl-7dbef567e6cec78adb1d7ec55735935ca7de20fd.tar.xz
rust-openssl-7dbef567e6cec78adb1d7ec55735935ca7de20fd.zip
Remove some stray manual impls
Diffstat (limited to 'openssl/src/pkey.rs')
-rw-r--r--openssl/src/pkey.rs12
1 files changed, 2 insertions, 10 deletions
diff --git a/openssl/src/pkey.rs b/openssl/src/pkey.rs
index b5ccd3cc..ee564836 100644
--- a/openssl/src/pkey.rs
+++ b/openssl/src/pkey.rs
@@ -4,7 +4,7 @@ use std::mem;
use ffi;
use {cvt, cvt_p};
-use bio::{MemBio, MemBioSlice};
+use bio::MemBioSlice;
use dh::Dh;
use dsa::Dsa;
use ec_key::EcKey;
@@ -48,20 +48,12 @@ impl PKeyRef {
}
}
+ public_key_to_pem!(ffi::PEM_write_bio_PUBKEY);
private_key_to_pem!(ffi::PEM_write_bio_PKCS8PrivateKey);
private_key_to_der!(ffi::i2d_PrivateKey);
public_key_to_der!(ffi::i2d_PUBKEY);
- /// Encodes the public key in the PEM format.
- pub fn public_key_to_pem(&self) -> Result<Vec<u8>, ErrorStack> {
- let mem_bio = try!(MemBio::new());
- unsafe {
- try!(cvt(ffi::PEM_write_bio_PUBKEY(mem_bio.as_ptr(), self.as_ptr())));
- }
- Ok(mem_bio.get_buf().to_owned())
- }
-
/// Returns the size of the key.
///
/// This corresponds to the bit length of the modulus of an RSA key, and the bit length of the