Add note about faster rsa key generation

This commit is contained in:
Felix Ableitner 2025-03-10 17:44:52 +01:00
parent 716dee24ea
commit f75231ab48

View file

@ -54,6 +54,10 @@ impl Keypair {
} }
/// Generate a random asymmetric keypair for ActivityPub HTTP signatures. /// Generate a random asymmetric keypair for ActivityPub HTTP signatures.
///
/// Note that this method is very slow in debug mode. To make it faster, follow
/// instructions in the RSA crate's readme.
/// https://github.com/RustCrypto/RSA/blob/master/README.md
pub fn generate_actor_keypair() -> Result<Keypair, Error> { pub fn generate_actor_keypair() -> Result<Keypair, Error> {
let mut rng = rand::thread_rng(); let mut rng = rand::thread_rng();
let rsa = RsaPrivateKey::new(&mut rng, 2048)?; let rsa = RsaPrivateKey::new(&mut rng, 2048)?;