From bedfef49fe92db274371c86f82e5e10682f71614 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Thu, 10 Jun 2021 13:35:09 +0200 Subject: [PATCH] Add getSignatureDigestPrefix utility method to SignatureUtils --- .../main/java/org/pgpainless/signature/SignatureUtils.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pgpainless-core/src/main/java/org/pgpainless/signature/SignatureUtils.java b/pgpainless-core/src/main/java/org/pgpainless/signature/SignatureUtils.java index 2e265537..b8117fad 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/signature/SignatureUtils.java +++ b/pgpainless-core/src/main/java/org/pgpainless/signature/SignatureUtils.java @@ -32,6 +32,7 @@ import org.bouncycastle.openpgp.PGPSignature; import org.bouncycastle.openpgp.PGPSignatureGenerator; import org.bouncycastle.openpgp.PGPSignatureList; import org.bouncycastle.openpgp.operator.PGPContentSignerBuilder; +import org.bouncycastle.util.encoders.Hex; import org.pgpainless.PGPainless; import org.pgpainless.algorithm.HashAlgorithm; import org.pgpainless.algorithm.SignatureType; @@ -195,4 +196,8 @@ public class SignatureUtils { } return null; } + + public static String getSignatureDigestPrefix(PGPSignature signature) { + return Hex.toHexString(signature.getDigestPrefix()); + } }