diff options
author | Leonhard Markert <curiousleo@users.noreply.github.com> | 2019-11-13 21:20:24 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-11-15 12:54:45 +0100 |
commit | 7735b05e8cf82ae943e8b7b0dfed4a26cd6c3db4 (patch) | |
tree | a81bc7ea466fb7168aa6f766751f43daaf363f6f /openpgp | |
parent | c08eff5da06ae6df459d1e45133c2113557927fe (diff) |
openpgp: Add tpk::builder::CipherSuite::RSA4k.
Diffstat (limited to 'openpgp')
-rw-r--r-- | openpgp/src/tpk/builder.rs | 6 | ||||
-rw-r--r-- | openpgp/src/tpk/mod.rs | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/openpgp/src/tpk/builder.rs b/openpgp/src/tpk/builder.rs index eaaa2a1b..1a52c1fa 100644 --- a/openpgp/src/tpk/builder.rs +++ b/openpgp/src/tpk/builder.rs @@ -38,6 +38,8 @@ pub enum CipherSuite { P521, /// 2048 bit RSA with SHA512 and AES256 RSA2k, + /// 4096 bit RSA with SHA512 and AES256 + RSA4k, } impl Default for CipherSuite { @@ -58,6 +60,8 @@ impl CipherSuite { Key4::generate_rsa(2048), CipherSuite::RSA3k => Key4::generate_rsa(3072), + CipherSuite::RSA4k => + Key4::generate_rsa(4096), CipherSuite::Cv25519 | CipherSuite::P256 | CipherSuite::P384 | CipherSuite::P521 => { let sign = flags.can_certify() || flags.can_sign() @@ -599,7 +603,7 @@ mod tests { fn all_ciphersuites() { use self::CipherSuite::*; - for cs in vec![Cv25519, RSA3k, P256, P384, P521, RSA2k] { + for cs in vec![Cv25519, RSA3k, P256, P384, P521, RSA2k, RSA4k] { assert!(TPKBuilder::new() .set_cipher_suite(cs) .generate().is_ok()); diff --git a/openpgp/src/tpk/mod.rs b/openpgp/src/tpk/mod.rs index 263f41a6..c73a27fe 100644 --- a/openpgp/src/tpk/mod.rs +++ b/openpgp/src/tpk/mod.rs @@ -3045,7 +3045,8 @@ Pu1xwz57O4zo1VYf6TqHJzVC3OMvMUM2hhdecMUe5x6GorNaj6g= CipherSuite::P256, CipherSuite::P384, CipherSuite::P521, - CipherSuite::RSA2k ] + CipherSuite::RSA2k, + CipherSuite::RSA4k ] { let (alice, _) = TPKBuilder::new() .set_cipher_suite(*cs) |