mirror of
https://github.com/chatmail/core.git
synced 2026-05-17 05:46:30 +03:00
test(test-data): remove public keys that can be derived from secret keys
This commit is contained in:
13
src/pgp.rs
13
src/pgp.rs
@@ -142,6 +142,19 @@ pub struct KeyPair {
|
||||
pub secret: SignedSecretKey,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
impl KeyPair {
|
||||
/// Creates new keypair from a secret key.
|
||||
///
|
||||
/// Public key is split off the secret key.
|
||||
pub fn new(secret: SignedSecretKey) -> Result<Self> {
|
||||
use crate::key::DcSecretKey;
|
||||
|
||||
let public = secret.split_public_key()?;
|
||||
Ok(Self { public, secret })
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a new key pair.
|
||||
///
|
||||
/// Both secret and public key consist of signing primary key and encryption subkey
|
||||
|
||||
Reference in New Issue
Block a user