aboutsummaryrefslogtreecommitdiff
path: root/openssl/src
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2015-11-16 20:44:38 -0800
committerSteven Fackler <[email protected]>2015-11-16 20:56:02 -0800
commit1bc96a5b3dce5de6a161a0f04cb38d3b81e8615e (patch)
tree77ac87e14c0d4f050a68d9b0ef4db9e5d1633880 /openssl/src
parentMove HMAC_CTX_copy to sys-extras (diff)
downloadrust-openssl-1bc96a5b3dce5de6a161a0f04cb38d3b81e8615e.tar.xz
rust-openssl-1bc96a5b3dce5de6a161a0f04cb38d3b81e8615e.zip
Remove deprecated X509 methods
Diffstat (limited to 'openssl/src')
-rw-r--r--openssl/src/x509/mod.rs41
1 files changed, 4 insertions, 37 deletions
diff --git a/openssl/src/x509/mod.rs b/openssl/src/x509/mod.rs
index 8148749a..5574077a 100644
--- a/openssl/src/x509/mod.rs
+++ b/openssl/src/x509/mod.rs
@@ -103,10 +103,6 @@ impl X509StoreContext {
}
}
-// Backwards-compatibility
-pub use self::extension::KeyUsageOption as KeyUsage;
-pub use self::extension::ExtKeyUsageOption as ExtKeyUsage;
-
#[allow(non_snake_case)]
/// Generator of private key/certificate pairs
///
@@ -121,14 +117,15 @@ pub use self::extension::ExtKeyUsageOption as ExtKeyUsage;
/// use std::path::Path;
///
/// use openssl::crypto::hash::Type;
-/// use openssl::x509::{KeyUsage, X509Generator};
+/// use openssl::x509::X509Generator;
+/// use openssl::x509::extension::{Extension, KeyUsageOption};
///
/// let gen = X509Generator::new()
/// .set_bitlength(2048)
/// .set_valid_period(365*2)
-/// .set_CN("SuperMegaCorp Inc.")
+/// .add_name("CN".to_owned(), "SuperMegaCorp Inc.".to_owned())
/// .set_sign_hash(Type::SHA256)
-/// .set_usage(&[KeyUsage::DigitalSignature]);
+/// .add_extension(Extension::KeyUsage(vec![KeyUsageOption::DigitalSignature]));
///
/// let (cert, pkey) = gen.generate().unwrap();
///
@@ -184,22 +181,6 @@ impl X509Generator {
self
}
- #[allow(non_snake_case)]
- /// (deprecated) Sets Common Name of certificate
- ///
- /// This function is deprecated, use `X509Generator.add_name` instead.
- /// Don't use this function AND the `add_name` method
- pub fn set_CN(mut self, CN: &str) -> X509Generator {
- match self.names.get_mut(0) {
- Some(&mut(_,ref mut val)) => *val=CN.to_string(),
- _ => {} /* would move push here, but borrow checker won't let me */
- }
- if self.names.len()==0 {
- self.names.push(("CN".to_string(),CN.to_string()));
- }
- self
- }
-
/// Add attribute to the name of the certificate
///
/// ```
@@ -223,20 +204,6 @@ impl X509Generator {
self
}
- /// (deprecated) Sets what for certificate could be used
- ///
- /// This function is deprecated, use `X509Generator.add_extension` instead.
- pub fn set_usage(self, purposes: &[KeyUsage]) -> X509Generator {
- self.add_extension(Extension::KeyUsage(purposes.to_owned()))
- }
-
- /// (deprecated) Sets allowed extended usage of certificate
- ///
- /// This function is deprecated, use `X509Generator.add_extension` instead.
- pub fn set_ext_usage(self, purposes: &[ExtKeyUsage]) -> X509Generator {
- self.add_extension(Extension::ExtKeyUsage(purposes.to_owned()))
- }
-
/// Add an extension to a certificate
///
/// If the extension already exists, it will be replaced.