From 0c0f82ce2e00aa329a47fdb12fdcf007869973c5 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Fri, 24 Jun 2022 12:28:10 +0200 Subject: [PATCH] Add KeyRingInfo constructor that takes Policy instance --- .../java/org/pgpainless/key/info/KeyRingInfo.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/info/KeyRingInfo.java b/pgpainless-core/src/main/java/org/pgpainless/key/info/KeyRingInfo.java index b73087b4..9d761e38 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/info/KeyRingInfo.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/info/KeyRingInfo.java @@ -86,8 +86,19 @@ public class KeyRingInfo { * @param validationDate date of validation */ public KeyRingInfo(PGPKeyRing keys, Date validationDate) { + this(keys, PGPainless.getPolicy(), validationDate); + } + + /** + * Evaluate the key ring at the provided validation date. + * + * @param keys key ring + * @param policy policy + * @param validationDate validation date + */ + public KeyRingInfo(PGPKeyRing keys, Policy policy, Date validationDate) { this.keys = keys; - this.signatures = new Signatures(keys, validationDate, PGPainless.getPolicy()); + this.signatures = new Signatures(keys, validationDate, policy); this.evaluationDate = validationDate; this.primaryUserId = findPrimaryUserId(); }