utility to convert private keys into keypairs
This commit is contained in:
@@ -81,6 +81,15 @@ impl KeyPair {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<PrivateKey> for KeyPair {
|
||||
fn from(private_key: PrivateKey) -> Self {
|
||||
KeyPair {
|
||||
public_key: (&private_key).into(),
|
||||
private_key,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl PemStorableKeyPair for KeyPair {
|
||||
type PrivatePemKey = PrivateKey;
|
||||
type PublicPemKey = PublicKey;
|
||||
|
||||
@@ -91,6 +91,15 @@ impl KeyPair {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<PrivateKey> for KeyPair {
|
||||
fn from(private_key: PrivateKey) -> Self {
|
||||
KeyPair {
|
||||
public_key: (&private_key).into(),
|
||||
private_key,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl PemStorableKeyPair for KeyPair {
|
||||
type PrivatePemKey = PrivateKey;
|
||||
type PublicPemKey = PublicKey;
|
||||
|
||||
Reference in New Issue
Block a user