Package org.jvnet.hudson.crypto
Class CertificateUtil
- java.lang.Object
-
- org.jvnet.hudson.crypto.CertificateUtil
-
public class CertificateUtil extends Object
Utility code to work around horrible Java Crypto API.- Author:
- Kohsuke Kawaguchi
-
-
Constructor Summary
Constructors Constructor Description CertificateUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Set<TrustAnchor>
getDefaultRootCAs()
Obtains the list of default root CAs installed in the JRE.static X509TrustManager
getDefaultX509TrustManager()
Loads the system defaultX509TrustManager
.static PKIXCertPathValidatorResult
validatePath(List<X509Certificate> certs)
Validate a certificate chain.static PKIXCertPathValidatorResult
validatePath(List<X509Certificate> certs, Set<TrustAnchor> trustAnchors)
-
-
-
Method Detail
-
getDefaultRootCAs
public static Set<TrustAnchor> getDefaultRootCAs() throws NoSuchAlgorithmException, KeyStoreException
Obtains the list of default root CAs installed in the JRE.
-
getDefaultX509TrustManager
public static X509TrustManager getDefaultX509TrustManager() throws NoSuchAlgorithmException, KeyStoreException
Loads 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
-
-