diff options
| author | Gleb Kozyrev <[email protected]> | 2015-01-22 18:03:19 +0200 |
|---|---|---|
| committer | Gleb Kozyrev <[email protected]> | 2015-01-28 21:51:12 +0200 |
| commit | 71f84202053e81581dc619ae9df1c37cfc0482e6 (patch) | |
| tree | faf581a7f8739ae16af648c1caf386e0085672c6 /src/x509 | |
| parent | Change Hasher and HMAC APIs closer to std::hash model (diff) | |
| download | rust-openssl-71f84202053e81581dc619ae9df1c37cfc0482e6.tar.xz rust-openssl-71f84202053e81581dc619ae9df1c37cfc0482e6.zip | |
Rename crypto::hash::HashType -> Type
s/HashType/Type/ to follow the current Rust style. Import Type as HashType in modules where the name might be ambiguous.
[breaking change]
Diffstat (limited to 'src/x509')
| -rw-r--r-- | src/x509/mod.rs | 11 | ||||
| -rw-r--r-- | src/x509/tests.rs | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/x509/mod.rs b/src/x509/mod.rs index 17b79deb..6c09f8b2 100644 --- a/src/x509/mod.rs +++ b/src/x509/mod.rs @@ -8,7 +8,8 @@ use std::ptr; use asn1::{Asn1Time}; use bio::{MemBio}; -use crypto::hash::{HashType}; +use crypto::hash; +use crypto::hash::Type as HashType; use crypto::pkey::{PKey}; use crypto::rand::rand_bytes; use ffi; @@ -152,14 +153,14 @@ impl<'a, T: AsStr<'a>> ToStr for Vec<T> { /// use std::old_io::{File, Open, Write}; /// # use std::old_io::fs; /// -/// use openssl::crypto::hash::HashType; +/// use openssl::crypto::hash::Type; /// use openssl::x509::{KeyUsage, X509Generator}; /// /// let gen = X509Generator::new() /// .set_bitlength(2048) /// .set_valid_period(365*2) /// .set_CN("SuperMegaCorp Inc.") -/// .set_sign_hash(HashType::SHA256) +/// .set_sign_hash(Type::SHA256) /// .set_usage(&[KeyUsage::DigitalSignature]); /// /// let (cert, pkey) = gen.generate().unwrap(); @@ -236,7 +237,7 @@ impl X509Generator { self } - pub fn set_sign_hash(mut self, hash_type: HashType) -> X509Generator { + pub fn set_sign_hash(mut self, hash_type: hash::Type) -> X509Generator { self.hash_type = hash_type; self } @@ -387,7 +388,7 @@ impl<'ctx> X509<'ctx> { } /// Returns certificate fingerprint calculated using provided hash - pub fn fingerprint(&self, hash_type: HashType) -> Option<Vec<u8>> { + pub fn fingerprint(&self, hash_type: hash::Type) -> Option<Vec<u8>> { let evp = hash_type.evp_md(); let len = hash_type.md_len(); let v: Vec<u8> = repeat(0).take(len as usize).collect(); diff --git a/src/x509/tests.rs b/src/x509/tests.rs index c9a655f2..4f24e70c 100644 --- a/src/x509/tests.rs +++ b/src/x509/tests.rs @@ -2,7 +2,7 @@ use serialize::hex::FromHex; use std::old_io::{File, Open, Read}; use std::old_io::util::NullWriter; -use crypto::hash::HashType::{SHA256}; +use crypto::hash::Type::{SHA256}; use x509::{X509, X509Generator}; use x509::KeyUsage::{DigitalSignature, KeyEncipherment}; use x509::ExtKeyUsage::{ClientAuth, ServerAuth}; |