Loading openssl/src/x509/extension.rs +8 −8 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ use x509::{X509v3Context, X509Extension}; /// See the `Extension` documentation for more information on the different /// variants. #[derive(Clone,Hash,PartialEq,Eq)] #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub enum ExtensionType { KeyUsage, ExtKeyUsage, Loading @@ -24,7 +24,7 @@ pub enum ExtensionType { /// Only one extension of each type is allow in a certificate. /// See RFC 3280 for more information about extensions. #[derive(Clone)] #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub enum Extension { /// The purposes of the key contained in the certificate KeyUsage(Vec<KeyUsageOption>), Loading Loading @@ -60,7 +60,7 @@ pub enum Extension { } impl Extension { #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub fn get_type(&self) -> ExtensionType { match self { &Extension::KeyUsage(_) => ExtensionType::KeyUsage, Loading @@ -74,7 +74,7 @@ impl Extension { } impl ExtensionType { #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub fn get_nid(&self) -> Option<Nid> { match self { &ExtensionType::KeyUsage => Some(nid::KEY_USAGE), Loading @@ -86,7 +86,7 @@ impl ExtensionType { } } #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub fn get_name(&self) -> Option<&str> { match self { &ExtensionType::OtherStr(ref s) => Some(s), Loading Loading @@ -127,7 +127,7 @@ impl ToString for Extension { } #[derive(Clone,Copy)] #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub enum KeyUsageOption { DigitalSignature, NonRepudiation, Loading Loading @@ -157,7 +157,7 @@ impl fmt::Display for KeyUsageOption { } #[derive(Clone)] #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub enum ExtKeyUsageOption { ServerAuth, ClientAuth, Loading Loading @@ -194,7 +194,7 @@ impl fmt::Display for ExtKeyUsageOption { } #[derive(Clone, Copy)] #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub enum AltNameOption { /// The value is specified as OID;content. See `man ASN1_generate_nconf` for more information on the content syntax. /// Loading openssl/src/x509/mod.rs +10 −10 Original line number Diff line number Diff line Loading @@ -97,7 +97,7 @@ impl X509StoreContextRef { } } #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub struct X509Generator { days: u32, names: Vec<(String, String)>, Loading @@ -114,7 +114,7 @@ impl X509Generator { /// CN: "rust-openssl" /// /// hash: SHA1 #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub fn new() -> X509Generator { X509Generator { days: 365, Loading @@ -125,7 +125,7 @@ impl X509Generator { } /// Sets certificate validity period in days since today #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub fn set_valid_period(mut self, days: u32) -> X509Generator { self.days = days; self Loading @@ -137,7 +137,7 @@ impl X509Generator { /// # let generator = openssl::x509::X509Generator::new(); /// generator.add_name("CN".to_string(),"example.com".to_string()); /// ``` #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub fn add_name(mut self, attr_type: String, attr_value: String) -> X509Generator { self.names.push((attr_type, attr_value)); self Loading @@ -149,7 +149,7 @@ impl X509Generator { /// # let generator = openssl::x509::X509Generator::new(); /// generator.add_names(vec![("CN".to_string(),"example.com".to_string())]); /// ``` #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub fn add_names<I>(mut self, attrs: I) -> X509Generator where I: IntoIterator<Item = (String, String)> { Loading @@ -168,7 +168,7 @@ impl X509Generator { /// # let generator = openssl::x509::X509Generator::new(); /// generator.add_extension(KeyUsage(vec![DigitalSignature, KeyEncipherment])); /// ``` #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub fn add_extension(mut self, ext: extension::Extension) -> X509Generator { self.extensions.add(ext); self Loading @@ -185,7 +185,7 @@ impl X509Generator { /// # let generator = openssl::x509::X509Generator::new(); /// generator.add_extensions(vec![KeyUsage(vec![DigitalSignature, KeyEncipherment])]); /// ``` #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub fn add_extensions<I>(mut self, exts: I) -> X509Generator where I: IntoIterator<Item = extension::Extension> { Loading @@ -196,14 +196,14 @@ impl X509Generator { self } #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub fn set_sign_hash(mut self, hash_type: MessageDigest) -> X509Generator { self.hash_type = hash_type; self } /// Sets the certificate public-key, then self-sign and return it #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub fn sign(&self, p_key: &PKeyRef) -> Result<X509, ErrorStack> { let mut builder = try!(X509::builder()); try!(builder.set_version(2)); Loading Loading @@ -255,7 +255,7 @@ impl X509Generator { } /// Obtain a certificate signing request (CSR) #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub fn request(&self, p_key: &PKeyRef) -> Result<X509Req, ErrorStack> { let cert = match self.sign(p_key) { Ok(c) => c, Loading Loading
openssl/src/x509/extension.rs +8 −8 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ use x509::{X509v3Context, X509Extension}; /// See the `Extension` documentation for more information on the different /// variants. #[derive(Clone,Hash,PartialEq,Eq)] #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub enum ExtensionType { KeyUsage, ExtKeyUsage, Loading @@ -24,7 +24,7 @@ pub enum ExtensionType { /// Only one extension of each type is allow in a certificate. /// See RFC 3280 for more information about extensions. #[derive(Clone)] #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub enum Extension { /// The purposes of the key contained in the certificate KeyUsage(Vec<KeyUsageOption>), Loading Loading @@ -60,7 +60,7 @@ pub enum Extension { } impl Extension { #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub fn get_type(&self) -> ExtensionType { match self { &Extension::KeyUsage(_) => ExtensionType::KeyUsage, Loading @@ -74,7 +74,7 @@ impl Extension { } impl ExtensionType { #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub fn get_nid(&self) -> Option<Nid> { match self { &ExtensionType::KeyUsage => Some(nid::KEY_USAGE), Loading @@ -86,7 +86,7 @@ impl ExtensionType { } } #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub fn get_name(&self) -> Option<&str> { match self { &ExtensionType::OtherStr(ref s) => Some(s), Loading Loading @@ -127,7 +127,7 @@ impl ToString for Extension { } #[derive(Clone,Copy)] #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub enum KeyUsageOption { DigitalSignature, NonRepudiation, Loading Loading @@ -157,7 +157,7 @@ impl fmt::Display for KeyUsageOption { } #[derive(Clone)] #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub enum ExtKeyUsageOption { ServerAuth, ClientAuth, Loading Loading @@ -194,7 +194,7 @@ impl fmt::Display for ExtKeyUsageOption { } #[derive(Clone, Copy)] #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub enum AltNameOption { /// The value is specified as OID;content. See `man ASN1_generate_nconf` for more information on the content syntax. /// Loading
openssl/src/x509/mod.rs +10 −10 Original line number Diff line number Diff line Loading @@ -97,7 +97,7 @@ impl X509StoreContextRef { } } #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub struct X509Generator { days: u32, names: Vec<(String, String)>, Loading @@ -114,7 +114,7 @@ impl X509Generator { /// CN: "rust-openssl" /// /// hash: SHA1 #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub fn new() -> X509Generator { X509Generator { days: 365, Loading @@ -125,7 +125,7 @@ impl X509Generator { } /// Sets certificate validity period in days since today #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub fn set_valid_period(mut self, days: u32) -> X509Generator { self.days = days; self Loading @@ -137,7 +137,7 @@ impl X509Generator { /// # let generator = openssl::x509::X509Generator::new(); /// generator.add_name("CN".to_string(),"example.com".to_string()); /// ``` #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub fn add_name(mut self, attr_type: String, attr_value: String) -> X509Generator { self.names.push((attr_type, attr_value)); self Loading @@ -149,7 +149,7 @@ impl X509Generator { /// # let generator = openssl::x509::X509Generator::new(); /// generator.add_names(vec![("CN".to_string(),"example.com".to_string())]); /// ``` #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub fn add_names<I>(mut self, attrs: I) -> X509Generator where I: IntoIterator<Item = (String, String)> { Loading @@ -168,7 +168,7 @@ impl X509Generator { /// # let generator = openssl::x509::X509Generator::new(); /// generator.add_extension(KeyUsage(vec![DigitalSignature, KeyEncipherment])); /// ``` #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub fn add_extension(mut self, ext: extension::Extension) -> X509Generator { self.extensions.add(ext); self Loading @@ -185,7 +185,7 @@ impl X509Generator { /// # let generator = openssl::x509::X509Generator::new(); /// generator.add_extensions(vec![KeyUsage(vec![DigitalSignature, KeyEncipherment])]); /// ``` #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub fn add_extensions<I>(mut self, exts: I) -> X509Generator where I: IntoIterator<Item = extension::Extension> { Loading @@ -196,14 +196,14 @@ impl X509Generator { self } #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub fn set_sign_hash(mut self, hash_type: MessageDigest) -> X509Generator { self.hash_type = hash_type; self } /// Sets the certificate public-key, then self-sign and return it #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub fn sign(&self, p_key: &PKeyRef) -> Result<X509, ErrorStack> { let mut builder = try!(X509::builder()); try!(builder.set_version(2)); Loading Loading @@ -255,7 +255,7 @@ impl X509Generator { } /// Obtain a certificate signing request (CSR) #[deprecated(since = "0.9.1", note = "use X509Builder and X509ReqBuilder instead")] #[deprecated(since = "0.9.7", note = "use X509Builder and X509ReqBuilder instead")] pub fn request(&self, p_key: &PKeyRef) -> Result<X509Req, ErrorStack> { let cert = match self.sign(p_key) { Ok(c) => c, Loading