Package org.conscrypt
Class CertificatePriorityComparator
java.lang.Object
org.conscrypt.CertificatePriorityComparator
- All Implemented Interfaces:
Comparator<X509Certificate>
@Internal
public final class CertificatePriorityComparator
extends Object
implements Comparator<X509Certificate>
Comparator
for prioritizing certificates in path building.
The sort order is as follows:
- Self-issued certificates first.
- Strength of certificates descending (EC before RSA, key size descending, signature algorithm strength descending).
- notAfter date descending.
- notBefore date descending.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
compare
(X509Certificate lhs, X509Certificate rhs) private int
compareKeyAlgorithm
(PublicKey lhs, PublicKey rhs) private int
compareKeySize
(PublicKey lhs, PublicKey rhs) private int
private int
compareStrength
(X509Certificate lhs, X509Certificate rhs) private int
getKeySize
(PublicKey pkey) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
ALGORITHM_OID_PRIORITY_MAP
Map of signature algorithm OIDs to priorities. OIDs with a lower priority will be sorted before those with higher. -
PRIORITY_MD5
-
PRIORITY_SHA1
-
PRIORITY_SHA224
-
PRIORITY_SHA256
-
PRIORITY_SHA384
-
PRIORITY_SHA512
-
PRIORITY_UNKNOWN
-
-
Constructor Details
-
CertificatePriorityComparator
public CertificatePriorityComparator()
-
-
Method Details
-
compare
- Specified by:
compare
in interfaceComparator<X509Certificate>
-
compareStrength
-
compareKeyAlgorithm
-
compareKeySize
-
getKeySize
-
compareSignatureAlgorithm
-