diff options
| author | Steven Fackler <[email protected]> | 2015-01-28 13:02:55 -0800 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2015-01-28 13:02:55 -0800 |
| commit | 8b47daae66db425574fe85a687a7a09966feb1b3 (patch) | |
| tree | faf581a7f8739ae16af648c1caf386e0085672c6 /src/crypto/pkey.rs | |
| parent | Release v0.2.18 (diff) | |
| parent | Rename crypto::hash::HashType -> Type (diff) | |
| download | rust-openssl-8b47daae66db425574fe85a687a7a09966feb1b3.tar.xz rust-openssl-8b47daae66db425574fe85a687a7a09966feb1b3.zip | |
Merge pull request #141 from gkoz/borrow_mut
Improve Hasher and HMAC APIs
Diffstat (limited to 'src/crypto/pkey.rs')
| -rw-r--r-- | src/crypto/pkey.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/crypto/pkey.rs b/src/crypto/pkey.rs index 1aa5cc0e..c20fae4f 100644 --- a/src/crypto/pkey.rs +++ b/src/crypto/pkey.rs @@ -3,7 +3,8 @@ use std::iter::repeat; use std::mem; use std::ptr; use bio::{MemBio}; -use crypto::hash::HashType; +use crypto::hash; +use crypto::hash::Type as HashType; use ffi; use ssl::error::{SslError, StreamError}; @@ -276,7 +277,7 @@ impl PKey { */ pub fn verify(&self, m: &[u8], s: &[u8]) -> bool { self.verify_with_hash(m, s, HashType::SHA256) } - pub fn sign_with_hash(&self, s: &[u8], hash: HashType) -> Vec<u8> { + pub fn sign_with_hash(&self, s: &[u8], hash: hash::Type) -> Vec<u8> { unsafe { let rsa = ffi::EVP_PKEY_get1_RSA(self.evp); let len = ffi::RSA_size(rsa); @@ -300,7 +301,7 @@ impl PKey { } } - pub fn verify_with_hash(&self, m: &[u8], s: &[u8], hash: HashType) -> bool { + pub fn verify_with_hash(&self, m: &[u8], s: &[u8], hash: hash::Type) -> bool { unsafe { let rsa = ffi::EVP_PKEY_get1_RSA(self.evp); @@ -332,7 +333,7 @@ impl Drop for PKey { #[cfg(test)] mod tests { - use crypto::hash::HashType::{MD5, SHA1}; + use crypto::hash::Type::{MD5, SHA1}; #[test] fn test_gen_pub() { |