Skip to content

Commit 936a1b7

Browse files
committed
Use key_data to simplify code
Signed-off-by: Wiktor Kwapisiewicz <[email protected]>
1 parent dcec785 commit 936a1b7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

examples/pgp-wrapper.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,7 @@ fn main() -> testresult::TestResult {
372372
let mut keyflags = KeyFlags::default();
373373
keyflags.set_encrypt_comms(true);
374374
keyflags.set_encrypt_storage(true);
375-
let PublicCredential::Key(pubkey) = &decryption_id.pubkey else {
376-
panic!("Only pubkeys are supported.");
377-
};
375+
let pubkey = decryption_id.pubkey.key_data();
378376
let pk = ssh_to_pgp(pubkey.clone(), KeyRole::Decryption);
379377
vec![pgp::PublicSubkey::new(
380378
pgp::packet::PublicSubkey::new(

0 commit comments

Comments
 (0)