mirror of
https://github.com/chatmail/core.git
synced 2026-05-04 22:06:29 +03:00
Pre-generate more keys for use in integration tests
This commit is contained in:
committed by
Alexander Krotov
parent
515c753d11
commit
1144a536a5
21
src/key.rs
21
src/key.rs
@@ -595,4 +595,25 @@ i8pcjGO+IZffvyZJVRWfVooBJmWWbPB1pueo3tx8w3+fcuzpxz+RLFKaPyqXO+dD
|
||||
store_self_keypair(&t.ctx, &KEYPAIR, KeyPairUse::Default).unwrap();
|
||||
assert_eq!(nrows(), 1);
|
||||
}
|
||||
|
||||
// Convenient way to create a new key if you need one, run with
|
||||
// `cargo test key::tests::gen_key`.
|
||||
// #[test]
|
||||
// fn gen_key() {
|
||||
// let name = "fiona";
|
||||
// let keypair = crate::pgp::create_keypair(
|
||||
// EmailAddress::new(&format!("{}@example.net", name)).unwrap(),
|
||||
// )
|
||||
// .unwrap();
|
||||
// std::fs::write(
|
||||
// format!("test-data/key/{}-public.asc", name),
|
||||
// keypair.public.to_base64(),
|
||||
// )
|
||||
// .unwrap();
|
||||
// std::fs::write(
|
||||
// format!("test-data/key/{}-secret.asc", name),
|
||||
// keypair.secret.to_base64(),
|
||||
// )
|
||||
// .unwrap();
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -58,11 +58,7 @@ pub(crate) fn logging_cb(_ctx: &Context, evt: Event) {
|
||||
///
|
||||
/// This saves CPU cycles by avoiding having to generate a key.
|
||||
///
|
||||
/// The keypair was created using (this is purposefully not a doctest, it would be slow):
|
||||
/// let keypair = crate::pgp::create_keypair(EmailAddress::new("alice@example.com"))
|
||||
/// .unwrap();
|
||||
/// println!("{}", keypair.public.to_base64(64));
|
||||
/// println!("{}", keypair.secret.to_base64(64));
|
||||
/// The keypair was created using the crate::key::tests::gen_key test.
|
||||
pub(crate) fn alice_keypair() -> key::KeyPair {
|
||||
let addr = EmailAddress::new("alice@example.com").unwrap();
|
||||
let public =
|
||||
|
||||
Reference in New Issue
Block a user