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 TypeMethodDescriptionintcompare(X509Certificate lhs, X509Certificate rhs) private intcompareKeyAlgorithm(PublicKey lhs, PublicKey rhs) private intcompareKeySize(PublicKey lhs, PublicKey rhs) private intprivate intcompareStrength(X509Certificate lhs, X509Certificate rhs) private intgetKeySize(PublicKey pkey) 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
-
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:
comparein interfaceComparator<X509Certificate>
-
compareStrength
-
compareKeyAlgorithm
-
compareKeySize
-
getKeySize
-
compareSignatureAlgorithm
-