diff --git a/deltachat-ffi/deltachat.h b/deltachat-ffi/deltachat.h index ff76c3d7c..e4d268262 100644 --- a/deltachat-ffi/deltachat.h +++ b/deltachat-ffi/deltachat.h @@ -443,7 +443,9 @@ char* dc_get_blobdir (const dc_context_t* context); * DC_KEY_GEN_RSA2048 (1)= * generate RSA 2048 keypair * DC_KEY_GEN_ED25519 (2)= - * generate Ed25519 keypair + * generate Curve25519 keypair + * DC_KEY_GEN_RSA4096 (3)= + * generate RSA 4096 keypair * - `save_mime_headers` = 1=save mime headers * and make dc_get_mime_headers() work for subsequent calls, * 0=do not save mime headers (default) @@ -6293,6 +6295,7 @@ void dc_event_unref(dc_event_t* event); #define DC_KEY_GEN_DEFAULT 0 #define DC_KEY_GEN_RSA2048 1 #define DC_KEY_GEN_ED25519 2 +#define DC_KEY_GEN_RSA4096 3 /** diff --git a/node/constants.js b/node/constants.js index d55d92782..dcbe52daf 100644 --- a/node/constants.js +++ b/node/constants.js @@ -90,6 +90,7 @@ module.exports = { DC_KEY_GEN_DEFAULT: 0, DC_KEY_GEN_ED25519: 2, DC_KEY_GEN_RSA2048: 1, + DC_KEY_GEN_RSA4096: 3, DC_LP_AUTH_NORMAL: 4, DC_LP_AUTH_OAUTH2: 2, DC_MEDIA_QUALITY_BALANCED: 0, diff --git a/node/lib/constants.ts b/node/lib/constants.ts index cacbd570d..f97e44426 100644 --- a/node/lib/constants.ts +++ b/node/lib/constants.ts @@ -90,6 +90,7 @@ export enum C { DC_KEY_GEN_DEFAULT = 0, DC_KEY_GEN_ED25519 = 2, DC_KEY_GEN_RSA2048 = 1, + DC_KEY_GEN_RSA4096 = 3, DC_LP_AUTH_NORMAL = 4, DC_LP_AUTH_OAUTH2 = 2, DC_MEDIA_QUALITY_BALANCED = 0, diff --git a/src/constants.rs b/src/constants.rs index c3eb33f1d..957a09ef3 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -62,8 +62,15 @@ pub enum MediaQuality { pub enum KeyGenType { #[default] Default = 0, + + /// 2048-bit RSA. Rsa2048 = 1, + + /// [Ed25519](https://ed25519.cr.yp.to/) signature and X25519 encryption. Ed25519 = 2, + + /// 4096-bit RSA. + Rsa4096 = 3, } /// Video chat URL type. @@ -231,6 +238,7 @@ mod tests { assert_eq!(KeyGenType::Default, KeyGenType::from_i32(0).unwrap()); assert_eq!(KeyGenType::Rsa2048, KeyGenType::from_i32(1).unwrap()); assert_eq!(KeyGenType::Ed25519, KeyGenType::from_i32(2).unwrap()); + assert_eq!(KeyGenType::Rsa4096, KeyGenType::from_i32(3).unwrap()); } #[test] diff --git a/src/pgp.rs b/src/pgp.rs index 0113cd5b9..d4a5a072b 100644 --- a/src/pgp.rs +++ b/src/pgp.rs @@ -142,6 +142,7 @@ pub struct KeyPair { pub(crate) fn create_keypair(addr: EmailAddress, keygen_type: KeyGenType) -> Result { let (secret_key_type, public_key_type) = match keygen_type { KeyGenType::Rsa2048 => (PgpKeyType::Rsa(2048), PgpKeyType::Rsa(2048)), + KeyGenType::Rsa4096 => (PgpKeyType::Rsa(4096), PgpKeyType::Rsa(4096)), KeyGenType::Ed25519 | KeyGenType::Default => (PgpKeyType::EdDSA, PgpKeyType::ECDH), };