Class SignatureValidityComparator
java.lang.Object
org.pgpainless.signature.consumer.SignatureValidityComparator
- All Implemented Interfaces:
Comparator<org.bouncycastle.openpgp.PGPSignature>
public class SignatureValidityComparator
extends Object
implements Comparator<org.bouncycastle.openpgp.PGPSignature>
Comparator which sorts signatures based on an ordering and on revocation hardness.
If a list of signatures gets ordered using this comparator, hard revocations will always
come first.
Further, signatures are ordered by date according to the
SignatureCreationDateComparator.Order.-
Constructor Summary
ConstructorsConstructorDescriptionCreate a newSignatureValidityComparatorwhich orders signatures the oldest first.Create a newSignatureValidityComparatorwhich orders signatures following the passed ordering. -
Method Summary
Modifier and TypeMethodDescriptionintcompare(org.bouncycastle.openpgp.PGPSignature one, org.bouncycastle.openpgp.PGPSignature two) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
SignatureValidityComparator
public SignatureValidityComparator()Create a newSignatureValidityComparatorwhich orders signatures the oldest first. Still, hard revocations will come first. -
SignatureValidityComparator
Create a newSignatureValidityComparatorwhich orders signatures following the passed ordering. Still, hard revocations will come first.- Parameters:
order- order of creation dates
-
-
Method Details
-
compare
public int compare(org.bouncycastle.openpgp.PGPSignature one, org.bouncycastle.openpgp.PGPSignature two) - Specified by:
comparein interfaceComparator<org.bouncycastle.openpgp.PGPSignature>
-