Add helper fn vka_as_uploadable_key()
This commit is contained in:
parent
0fffb0c91b
commit
e34285dc68
1 changed files with 9 additions and 0 deletions
|
@ -57,6 +57,15 @@ impl SequoiaKey {
|
|||
}
|
||||
}
|
||||
|
||||
/// Helper fn: get a CardUploadableKey for a ValidErasedKeyAmalgamation
|
||||
pub fn vka_as_uploadable_key(
|
||||
vka: ValidErasedKeyAmalgamation<SecretParts>,
|
||||
password: Option<String>,
|
||||
) -> Box<dyn CardUploadableKey> {
|
||||
let sqk = SequoiaKey::new(vka, password);
|
||||
Box::new(sqk)
|
||||
}
|
||||
|
||||
/// Implement the `CardUploadableKey` trait that openpgp-card uses to
|
||||
/// upload (sub)keys to a card.
|
||||
impl CardUploadableKey for SequoiaKey {
|
||||
|
|
Loading…
Reference in a new issue