net.i2p.crypto
Class CertUtil

java.lang.Object
  extended by net.i2p.crypto.CertUtil

public class CertUtil
extends Object

Java X.509 certificate utilities, consolidated from various places.

Since:
0.9.9

Constructor Summary
CertUtil()
           
 
Method Summary
static String getSubjectValue(X509Certificate cert, String type)
          Get a value out of the subject distinguished name.
static boolean saveCert(Certificate cert, File file)
          Modified from: http://www.exampledepot.com/egs/java.security.cert/ExportCert.html This method writes a certificate to a file in base64 format.
 
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

saveCert

public static boolean saveCert(Certificate cert,
                               File file)
Modified from: http://www.exampledepot.com/egs/java.security.cert/ExportCert.html This method writes a certificate to a file in base64 format.

Returns:
success
Since:
0.8.2, moved from SSLEepGet in 0.9.9

getSubjectValue

public static String getSubjectValue(X509Certificate cert,
                                     String type)
Get a value out of the subject distinguished name. Warning - unsupported in Android (no javax.naming), returns null.

Parameters:
type - e.g. "CN"
Returns:
value or null if not found