summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2021-02-19 14:02:36 +0100
committerJustus Winter <justus@sequoia-pgp.org>2021-02-19 14:02:36 +0100
commit2567736e3c06aea0aba200c9e6516c4dc360f0d3 (patch)
tree5756d018b23a451f85f7d08151f4dcf9105a3e8c
parent1d7ef6ebc22bce6dfe0ea95c2f246a4b552ced47 (diff)
openpgp: Use high-level interface to create direct key signature.
-rw-r--r--openpgp/src/cert/revoke.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/openpgp/src/cert/revoke.rs b/openpgp/src/cert/revoke.rs
index 605c61c3..c0f321db 100644
--- a/openpgp/src/cert/revoke.rs
+++ b/openpgp/src/cert/revoke.rs
@@ -9,7 +9,6 @@ use crate::{
use crate::types::{
ReasonForRevocation,
};
-use crate::crypto::hash::Hash;
use crate::crypto::Signer;
use crate::packet::{
Key,
@@ -227,12 +226,9 @@ impl CertRevocationBuilder {
-> Result<Signature>
where H: Into<Option<HashAlgorithm>>
{
- let hash_algo = hash_algo.into().unwrap_or(HashAlgorithm::SHA512);
- let mut hash = hash_algo.context()?;
-
- cert.primary_key().hash(&mut hash);
-
- self.builder.sign_hash(signer, hash)
+ self.builder
+ .set_hash_algo(hash_algo.into().unwrap_or(HashAlgorithm::SHA512))
+ .sign_direct_key(signer, cert.primary_key().key())
}
}