summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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())
}
}