summaryrefslogtreecommitdiffstats
path: root/openpgp/src/packet/pkesk.rs
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-02-17 15:24:40 +0100
committerJustus Winter <justus@sequoia-pgp.org>2020-02-17 15:24:40 +0100
commit7dfe2d273a8386952ffea169aa600f05c6d34cb7 (patch)
treebf7ae6555ec14d005e34ef2dccda2beaa2362cb3 /openpgp/src/packet/pkesk.rs
parent6ae9d4ec0661d21f1c1579b901d0cc400811c43c (diff)
openpgp: Make PKESK3::for_recipient polymorphic over key parts.
Diffstat (limited to 'openpgp/src/packet/pkesk.rs')
-rw-r--r--openpgp/src/packet/pkesk.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/openpgp/src/packet/pkesk.rs b/openpgp/src/packet/pkesk.rs
index 8f32d86d..0a39cd60 100644
--- a/openpgp/src/packet/pkesk.rs
+++ b/openpgp/src/packet/pkesk.rs
@@ -73,11 +73,12 @@ impl PKESK3 {
///
/// The given symmetric algorithm must match the algorithm that is
/// used to encrypt the payload.
- pub fn for_recipient<R>(algo: SymmetricAlgorithm,
- session_key: &SessionKey,
- recipient: &Key<key::PublicParts, R>)
+ pub fn for_recipient<P, R>(algo: SymmetricAlgorithm,
+ session_key: &SessionKey,
+ recipient: &Key<P, R>)
-> Result<PKESK3>
- where R: key::KeyRole
+ where P: key::KeyParts,
+ R: key::KeyRole,
{
// We need to prefix the cipher specifier to the session key,
// and a two-octet checksum.