diff --git a/src/main/java/com/sparrowwallet/drongo/pgp/PGPUtils.java b/src/main/java/com/sparrowwallet/drongo/pgp/PGPUtils.java index 2b218b2..26d076b 100644 --- a/src/main/java/com/sparrowwallet/drongo/pgp/PGPUtils.java +++ b/src/main/java/com/sparrowwallet/drongo/pgp/PGPUtils.java @@ -75,8 +75,10 @@ public class PGPUtils { if(subkeyIdentifier != null) { PGPPublicKey signedByKey = null; long primaryKeyId = subkeyIdentifier.getPrimaryKeyId(); + boolean userProvidedKey = false; if(publicKeyRing != null && publicKeyRing.getPublicKey(primaryKeyId) != null) { signedByKey = publicKeyRing.getPublicKey(primaryKeyId); + userProvidedKey = true; log.debug("Signed using provided public key"); } else if(appPgpPublicKeyRingCollection != null && appPgpPublicKeyRingCollection.getPublicKey(primaryKeyId) != null && !isExpired(appPgpPublicKeyRingCollection.getPublicKey(primaryKeyId))) { @@ -102,7 +104,7 @@ public class PGPUtils { expired = isExpired(signedByKey); } - return new PGPVerificationResult(primaryKeyId, userId, signatureVerification.getSignature().getCreationTime(), expired); + return new PGPVerificationResult(primaryKeyId, userId, signatureVerification.getSignature().getCreationTime(), expired, userProvidedKey); } } } diff --git a/src/main/java/com/sparrowwallet/drongo/pgp/PGPVerificationResult.java b/src/main/java/com/sparrowwallet/drongo/pgp/PGPVerificationResult.java index 65b307c..de6dea6 100644 --- a/src/main/java/com/sparrowwallet/drongo/pgp/PGPVerificationResult.java +++ b/src/main/java/com/sparrowwallet/drongo/pgp/PGPVerificationResult.java @@ -2,4 +2,4 @@ package com.sparrowwallet.drongo.pgp; import java.util.Date; -public record PGPVerificationResult(long keyId, String userId, Date signatureTimestamp, boolean expired) { } +public record PGPVerificationResult(long keyId, String userId, Date signatureTimestamp, boolean expired, boolean userProvidedKey) { }