summaryrefslogtreecommitdiffstats
path: root/openpgp/src/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'openpgp/src/crypto')
-rw-r--r--openpgp/src/crypto/hash.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/openpgp/src/crypto/hash.rs b/openpgp/src/crypto/hash.rs
index 12502c10..539970f1 100644
--- a/openpgp/src/crypto/hash.rs
+++ b/openpgp/src/crypto/hash.rs
@@ -415,6 +415,20 @@ impl Signature {
Ok(digest)
}
+ /// Returns the message digest of the primary key binding over the
+ /// specified primary key and subkey.
+ pub fn hash_primary_key_binding<'a, P, Q, S>(
+ sig: S,
+ key: &Key<P, key::PrimaryRole>,
+ subkey: &Key<Q, key::SubordinateRole>)
+ -> Result<Vec<u8>>
+ where P: key::KeyParts,
+ Q: key::KeyParts,
+ S: Into<&'a signature::Builder>
+ {
+ Self::hash_subkey_binding(sig.into(), key, subkey)
+ }
+
/// Returns the message digest of the user ID binding over the
/// specified primary key, user ID, and signature.
pub fn hash_userid_binding<'a, S>(sig: S,