1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-12-22 19:08:00 +01:00

Add MessageMetadata.isVerifiedSigned() and .getVerifiedSignatures()

This commit is contained in:
Paul Schaub 2022-11-22 15:52:04 +01:00
parent c031ea9285
commit f005885318

View file

@ -186,6 +186,12 @@ public class MessageMetadata {
return isVerifiedInlineSignedBy(keys) || isVerifiedDetachedSignedBy(keys); return isVerifiedInlineSignedBy(keys) || isVerifiedDetachedSignedBy(keys);
} }
public List<SignatureVerification> getVerifiedSignatures() {
List<SignatureVerification> allVerifiedSignatures = getVerifiedInlineSignatures();
allVerifiedSignatures.addAll(getVerifiedDetachedSignatures());
return allVerifiedSignatures;
}
public boolean isVerifiedDetachedSignedBy(@Nonnull PGPKeyRing keys) { public boolean isVerifiedDetachedSignedBy(@Nonnull PGPKeyRing keys) {
return containsSignatureBy(getVerifiedDetachedSignatures(), keys); return containsSignatureBy(getVerifiedDetachedSignatures(), keys);
} }
@ -403,6 +409,10 @@ public class MessageMetadata {
return firstOrNull(map(getEncryptionLayers(), encryptedData -> encryptedData.decryptionKey)); return firstOrNull(map(getEncryptionLayers(), encryptedData -> encryptedData.decryptionKey));
} }
public boolean isVerifiedSigned() {
return !getVerifiedSignatures().isEmpty();
}
public interface Packet { public interface Packet {
} }