## org.jvnet.hudson.crypto
Class CertificateUtil

    java.lang.Object
      org.jvnet.hudson.crypto.CertificateUtil

    public class CertificateUtil

extends java.lang.Object

Utility code to work around horrible Java Crypto API.

Author:
  Kohsuke Kawaguchi

Constructor Summary
`CertificateUtil()`

Method Summary
`static java.util.Set<java.security.cert.TrustAnchor>` `getDefaultRootCAs()` Obtains the list of default root CAs installed in the JRE.
`static javax.net.ssl.X509TrustManager` `getDefaultX509TrustManager()` Loads the system default `X509TrustManager`.
`static java.security.cert.PKIXCertPathValidatorResult` `validatePath(java.util.List<java.security.cert.X509Certificate> certs)` Validate a certificate chain.
`static java.security.cert.PKIXCertPathValidatorResult` `validatePath(java.util.List<java.security.cert.X509Certificate> certs, java.util.Set<java.security.cert.TrustAnchor> trustAnchors)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### CertificateUtil

    public CertificateUtil()

Method Detail

### getDefaultRootCAs

    public static java.util.Set<java.security.cert.TrustAnchor> getDefaultRootCAs()
                                                                           throws java.security.NoSuchAlgorithmException,
                                                                                  java.security.KeyStoreException

  Obtains the list of default root CAs installed in the JRE.

  Throws:
    `java.security.NoSuchAlgorithmException`
    `java.security.KeyStoreException`

### getDefaultX509TrustManager

    public static javax.net.ssl.X509TrustManager getDefaultX509TrustManager()
                                                                     throws java.security.NoSuchAlgorithmException,
                                                                            java.security.KeyStoreException

  Loads the system default `X509TrustManager`.

  Throws:
    `java.security.NoSuchAlgorithmException`
    `java.security.KeyStoreException`

### validatePath

    public static java.security.cert.PKIXCertPathValidatorResult validatePath(java.util.List<java.security.cert.X509Certificate> certs)
                                                                       throws java.security.GeneralSecurityException

  Validate a certificate chain. Normal return indicates a successful validation.

  Throws:
    `java.security.GeneralSecurityException`

### validatePath

    public static java.security.cert.PKIXCertPathValidatorResult validatePath(java.util.List<java.security.cert.X509Certificate> certs,
                                                                              java.util.Set<java.security.cert.TrustAnchor> trustAnchors)
                                                                       throws java.security.GeneralSecurityException

  Throws:
    `java.security.GeneralSecurityException`

Copyright © 2012. All Rights Reserved.