test(test-data): remove public keys that can be derived from secret keys

This commit is contained in:
link2xt
2024-09-10 23:24:34 +00:00
parent 7743072411
commit 1caf672904
5 changed files with 16 additions and 85 deletions

View File

@@ -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