Add a helper method to construct a CardUploadableKey from a ValidErasedKeyAmalgamation
This commit is contained in:
parent
42c4f14d57
commit
38fb6bd970
1 changed files with 8 additions and 0 deletions
|
@ -58,6 +58,14 @@ impl SequoiaKey {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
/// Implement the `CardUploadableKey` trait that openpgp-card uses to
|
||||||
/// upload (sub)keys to a card.
|
/// upload (sub)keys to a card.
|
||||||
impl CardUploadableKey for SequoiaKey {
|
impl CardUploadableKey for SequoiaKey {
|
||||||
|
|
Loading…
Reference in a new issue