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:

  1. Self-issued certificates first.
  2. Strength of certificates descending (EC before RSA, key size descending, signature algorithm strength descending).
  3. notAfter date descending.
  4. notBefore date descending.

  • Field Details

    • ALGORITHM_OID_PRIORITY_MAP

      private static final Map<String,Integer> 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

      private static final Integer PRIORITY_MD5
    • PRIORITY_SHA1

      private static final Integer PRIORITY_SHA1
    • PRIORITY_SHA224

      private static final Integer PRIORITY_SHA224
    • PRIORITY_SHA256

      private static final Integer PRIORITY_SHA256
    • PRIORITY_SHA384

      private static final Integer PRIORITY_SHA384
    • PRIORITY_SHA512

      private static final Integer PRIORITY_SHA512
    • PRIORITY_UNKNOWN

      private static final Integer PRIORITY_UNKNOWN
  • Constructor Details

    • CertificatePriorityComparator

      public CertificatePriorityComparator()
  • Method Details