Package org.jvnet.hudson.crypto
Class CertificateUtil
java.lang.Object
org.jvnet.hudson.crypto.CertificateUtil
Utility code to work around horrible Java Crypto API.
- Author:
- Kohsuke Kawaguchi
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Set<TrustAnchor>
Obtains the list of default root CAs installed in the JRE.static X509TrustManager
Loads the system defaultX509TrustManager
.static PKIXCertPathValidatorResult
validatePath
(List<X509Certificate> certs) Validate a certificate chain.static PKIXCertPathValidatorResult
validatePath
(List<X509Certificate> certs, Set<TrustAnchor> trustAnchors)
-
Constructor Details
-
CertificateUtil
public CertificateUtil()
-
-
Method Details
-
getDefaultRootCAs
public static Set<TrustAnchor> getDefaultRootCAs() throws NoSuchAlgorithmException, KeyStoreExceptionObtains the list of default root CAs installed in the JRE. -
getDefaultX509TrustManager
public static X509TrustManager getDefaultX509TrustManager() throws NoSuchAlgorithmException, KeyStoreExceptionLoads the system defaultX509TrustManager
. -
validatePath
public static PKIXCertPathValidatorResult validatePath(List<X509Certificate> certs) throws GeneralSecurityException Validate a certificate chain. Normal return indicates a successful validation.- Throws:
GeneralSecurityException
-
validatePath
public static PKIXCertPathValidatorResult validatePath(List<X509Certificate> certs, Set<TrustAnchor> trustAnchors) throws GeneralSecurityException - Throws:
GeneralSecurityException
-