aboutsummaryrefslogtreecommitdiff
path: root/openssl/src
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2016-08-07 22:46:14 -0700
committerSteven Fackler <[email protected]>2016-08-07 22:46:14 -0700
commit6e5cd7ef47c2d328f419b14cbef4f41337a7321a (patch)
tree611e60f29e6432b0e724c1129fe81e1269ed3f6b /openssl/src
parentFix example (diff)
downloadrust-openssl-6e5cd7ef47c2d328f419b14cbef4f41337a7321a.tar.xz
rust-openssl-6e5cd7ef47c2d328f419b14cbef4f41337a7321a.zip
Remove X509Generator::bitlenth
Diffstat (limited to 'openssl/src')
-rw-r--r--openssl/src/x509/mod.rs11
-rw-r--r--openssl/src/x509/tests.rs3
2 files changed, 1 insertions, 13 deletions
diff --git a/openssl/src/x509/mod.rs b/openssl/src/x509/mod.rs
index 407c5fbc..1bce71c6 100644
--- a/openssl/src/x509/mod.rs
+++ b/openssl/src/x509/mod.rs
@@ -122,7 +122,6 @@ impl X509StoreContext {
/// pkey.set_rsa(&rsa).unwrap();
///
/// let gen = X509Generator::new()
-/// .set_bitlength(2048)
/// .set_valid_period(365*2)
/// .add_name("CN".to_owned(), "SuperMegaCorp Inc.".to_owned())
/// .set_sign_hash(Type::SHA256)
@@ -133,7 +132,6 @@ impl X509StoreContext {
/// let pkey_pem = pkey.private_key_to_pem().unwrap();
/// ```
pub struct X509Generator {
- bits: u32,
days: u32,
names: Vec<(String, String)>,
extensions: Extensions,
@@ -143,8 +141,6 @@ pub struct X509Generator {
impl X509Generator {
/// Creates a new generator with the following defaults:
///
- /// bit length: 1024
- ///
/// validity period: 365 days
///
/// CN: "rust-openssl"
@@ -152,7 +148,6 @@ impl X509Generator {
/// hash: SHA1
pub fn new() -> X509Generator {
X509Generator {
- bits: 1024,
days: 365,
names: vec![],
extensions: Extensions::new(),
@@ -160,12 +155,6 @@ impl X509Generator {
}
}
- /// Sets desired bit length
- pub fn set_bitlength(mut self, bits: u32) -> X509Generator {
- self.bits = bits;
- self
- }
-
/// Sets certificate validity period in days since today
pub fn set_valid_period(mut self, days: u32) -> X509Generator {
self.days = days;
diff --git a/openssl/src/x509/tests.rs b/openssl/src/x509/tests.rs
index ba747c83..f701736a 100644
--- a/openssl/src/x509/tests.rs
+++ b/openssl/src/x509/tests.rs
@@ -12,7 +12,6 @@ use nid::Nid;
fn get_generator() -> X509Generator {
X509Generator::new()
- .set_bitlength(2048)
.set_valid_period(365 * 2)
.add_name("CN".to_string(), "test_me".to_string())
.set_sign_hash(SHA1)
@@ -26,7 +25,7 @@ fn get_generator() -> X509Generator {
}
fn pkey() -> PKey {
- let rsa = RSA::generate(512).unwrap();
+ let rsa = RSA::generate(2048).unwrap();
let mut pkey = PKey::new().unwrap();
pkey.set_rsa(&rsa).unwrap();
pkey