diff options
Diffstat (limited to 'openssl/src')
| -rw-r--r-- | openssl/src/pkey.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/openssl/src/pkey.rs b/openssl/src/pkey.rs index 31dc9d82..f8211b25 100644 --- a/openssl/src/pkey.rs +++ b/openssl/src/pkey.rs @@ -140,6 +140,7 @@ impl PKey { private_key_from_pem!(PKey, ffi::PEM_read_bio_PrivateKey); public_key_from_pem!(PKey, ffi::PEM_read_bio_PUBKEY); + public_key_from_der!(PKey, ffi::d2i_PUBKEY); /// Deserializes a DER-formatted PKCS#8 private key, using a callback to retrieve the password /// if the key is encrpyted. @@ -311,6 +312,12 @@ mod tests { } #[test] + fn test_public_key_from_der() { + let key = include_bytes!("../test/key.der.pub"); + PKey::public_key_from_der(key).unwrap(); + } + + #[test] fn test_pem() { let key = include_bytes!("../test/key.pem"); let key = PKey::private_key_from_pem(key).unwrap(); |