org.edg.security.info
Class CertUtil

java.lang.Object
  |
  +--org.edg.security.info.CertUtil

public class CertUtil
extends java.lang.Object

Reads a DER-encode, Base64-encoded, or PEM-encoded certificate from disk without using broken IAIK implementations...

Author:
mulmo

Constructor Summary
CertUtil()
           
 
Method Summary
static byte[] decodePem(java.io.InputStream in, java.lang.String tag)
           
static int getClientCertificate(java.security.cert.X509Certificate[] certChain)
          Ignores any proxy certificates and returns the index of the client cert
static java.security.cert.X509Certificate loadCertificate(java.lang.String filename)
           
static byte[] readFile(java.lang.String filename)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CertUtil

public CertUtil()
Method Detail

loadCertificate

public static java.security.cert.X509Certificate loadCertificate(java.lang.String filename)
                                                          throws java.io.IOException,
                                                                 java.security.cert.CertificateException
java.io.IOException
java.security.cert.CertificateException

readFile

public static byte[] readFile(java.lang.String filename)
                       throws java.io.IOException
java.io.IOException

decodePem

public static byte[] decodePem(java.io.InputStream in,
                               java.lang.String tag)
                        throws java.io.IOException
java.io.IOException

getClientCertificate

public static int getClientCertificate(java.security.cert.X509Certificate[] certChain)
Ignores any proxy certificates and returns the index of the client cert

Parameters:
certChain - a certificate chain, ordered such that the CA cert is the last
Returns:
int the index of the first non-proxy certificate encountered, or -1 if not found