public class CertificateUtils extends Object
Certificate
instances.Constructor and Description |
---|
CertificateUtils() |
Modifier and Type | Method and Description |
---|---|
static Set<X509Certificate> |
filterValid(Collection<X509Certificate> certificates)
Returns all valid certificates from the provided input, where validity references the notBefore and notAfter
dates of each certificate.
|
static Set<X509Certificate> |
filterValid(X509Certificate... certificates)
Returns all valid certificates from the provided input, where validity references the notBefore and notAfter
dates of each certificate.
|
static Date |
findValidPointInTime(X509Certificate... chain)
Attempts to find a point in time on which each of the certificates in the chain will pass
X509Certificate.checkValidity(Date) |
static X509Certificate |
identifyEndEntityCertificate(Collection<X509Certificate> chain)
Identifies the End Entity (or 'target') certificate in a chain.
|
static List<X509Certificate> |
order(Collection<X509Certificate> certificates)
Orders certificates, starting from the entity to be validated and progressing back toward the CA root.
|
static Set<TrustAnchor> |
toTrustAnchors(Collection<X509Certificate> certificates)
Transforms a collection of certificates into TrustAnchor instances.
|
static Set<TrustAnchor> |
toTrustAnchors(X509Certificate... certificates)
Transforms an array of certificates into TrustAnchor instances.
|
public static Set<X509Certificate> filterValid(X509Certificate... certificates)
X509Certificate.checkValidity()
returns
true.
The return value of this method is a Set, which means that duplicate certificates in the input are implicitly
being removed from the result.certificates
- An array of certificates (possibly empty, possibly null).public static Set<X509Certificate> filterValid(Collection<X509Certificate> certificates)
X509Certificate.checkValidity()
returns
true.
The return value of this method is a Set, which means that duplicate certificates in the input are implicitly
being removed from the result.certificates
- A Collection of certificates (possibly empty, possibly null).public static Set<TrustAnchor> toTrustAnchors(X509Certificate... certificates)
certificates
- An array of certificates (possibly empty, possibly null).public static Set<TrustAnchor> toTrustAnchors(Collection<X509Certificate> certificates)
certificates
- An array of certificates (possibly empty, possibly null).public static List<X509Certificate> order(Collection<X509Certificate> certificates) throws CertificateException
certificates
- an unordered collection of certificates (cannot be null).CertificateException
- if there were multiple CA root certspublic static X509Certificate identifyEndEntityCertificate(Collection<X509Certificate> chain) throws CertificateException
chain
- The chain (possibly incomplete or unordered, but not null, empty or malformed).CertificateException
- When no valid chain was provided.public static Date findValidPointInTime(X509Certificate... chain)
X509Certificate.checkValidity(Date)
chain
- The chain for which to find a valid point in time (cannot be null, or empty).Copyright © 2003–2020 Ignite Realtime. All rights reserved.