org.jvnet.hudson.crypto
Class CertificateUtil

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

public class CertificateUtil
extends Object

Utility code to work around horrible Java Crypto API.

Author:
Kohsuke Kawaguchi

Constructor Summary
CertificateUtil()
           
 
Method Summary
static Set<TrustAnchor> getDefaultRootCAs()
          Obtains the list of default root CAs installed in the JRE.
static X509TrustManager getDefaultX509TrustManager()
          Loads the system default X509TrustManager.
static PKIXCertPathValidatorResult validatePath(List<X509Certificate> certs)
          Validate a certificate chain.
static PKIXCertPathValidatorResult validatePath(List<X509Certificate> certs, Set<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 Set<TrustAnchor> getDefaultRootCAs()
                                          throws NoSuchAlgorithmException,
                                                 KeyStoreException
Obtains the list of default root CAs installed in the JRE.

Throws:
NoSuchAlgorithmException
KeyStoreException

getDefaultX509TrustManager

public static X509TrustManager getDefaultX509TrustManager()
                                                   throws NoSuchAlgorithmException,
                                                          KeyStoreException
Loads the system default X509TrustManager.

Throws:
NoSuchAlgorithmException
KeyStoreException

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


Copyright © 2004-2011. All Rights Reserved.