org.eparapher.core.crypto.cert
Class CertificateInfo

java.lang.Object
  extended by org.eparapher.core.crypto.cert.CertificateInfo

public class CertificateInfo
extends Object

This class parse X509 certificate in order to show text informations for the end user.

Author:
Arnault MICHEL

Field Summary
static int ANYEXTENDEDKEYUSAGE
          Extended key usage constants
static int CLIENTAUTH
           
static int CODESIGNING
           
static int CRLSIGN
           
static int DATAENCIPHERMENT
           
static int DECIPHERONLY
           
static int DIGITALSIGNATURE
          KeyUsage constants
static int EMAILPROTECTION
           
static int ENCIPHERONLY
           
static String[] EXTENDEDKEYUSAGEOIDSTRINGS
           
static String[] EXTENDEDKEYUSAGETEXTS
           
static String GUID
          Microsoft altName for windows domain controller guid
static String GUID_OBJECTID
          ObjectID for upn altName for windows domain controller guid
static int IPSECENDSYSTEM
           
static int IPSECTUNNEL
           
static int IPSECUSER
           
static int KEYAGREEMENT
           
static int KEYCERTSIGN
           
static int KEYENCIPHERMENT
           
static String[] KEYUSAGETEXTS
           
static int NONREPUDIATION
           
static int OCSPSIGNING
           
static int SERVERAUTH
           
static int SMARTCARDLOGON
           
static int TIMESTAMPING
           
static String UPN
          Microsoft altName for windows smart card logon
static String UPN_OBJECTID
          ObjectID for upn altName for windows smart card logon
 
Constructor Summary
CertificateInfo(X509Certificate certificate)
           
 
Method Summary
static String GeneralNameAsText(org.bouncycastle.asn1.x509.GeneralName gn)
           
 String getCDPAsText()
           
static String getDNAsShortText(Principal dn)
           
static String getExtendedKeyUsageAsText(X509Certificate certificate)
           
static String getGuidAltName(X509Certificate cert)
          Gets the Microsoft specific GUID altName, that is encoded as an octect string.
static String getIssuerAsShortText(X509Certificate certificate)
           
static String getKeyUsageAsText(X509Certificate certificate)
           
static String getNotAfterAsFullText(X509Certificate certificate)
           
static String getNotAfterAsText(X509Certificate certificate)
           
static String getNotBeforeAsFullText(X509Certificate certificate)
           
static String getNotBeforeAsText(X509Certificate certificate)
           
static String getPublicKeyInfo(PublicKey pk)
           
static List<String> getSubjectAlternativeNames(X509Certificate certificate)
           
 String getSubjectAltName()
           
static String getSubjectAsShortText(X509Certificate certificate)
           
static String getUPNAltName(X509Certificate cert)
          Gets the Microsoft specific UPN altName.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIGITALSIGNATURE

public static final int DIGITALSIGNATURE
KeyUsage constants

See Also:
Constant Field Values

NONREPUDIATION

public static final int NONREPUDIATION
See Also:
Constant Field Values

KEYENCIPHERMENT

public static final int KEYENCIPHERMENT
See Also:
Constant Field Values

DATAENCIPHERMENT

public static final int DATAENCIPHERMENT
See Also:
Constant Field Values

KEYAGREEMENT

public static final int KEYAGREEMENT
See Also:
Constant Field Values

KEYCERTSIGN

public static final int KEYCERTSIGN
See Also:
Constant Field Values

CRLSIGN

public static final int CRLSIGN
See Also:
Constant Field Values

ENCIPHERONLY

public static final int ENCIPHERONLY
See Also:
Constant Field Values

DECIPHERONLY

public static final int DECIPHERONLY
See Also:
Constant Field Values

KEYUSAGETEXTS

public static final String[] KEYUSAGETEXTS

ANYEXTENDEDKEYUSAGE

public static final int ANYEXTENDEDKEYUSAGE
Extended key usage constants

See Also:
Constant Field Values

SERVERAUTH

public static final int SERVERAUTH
See Also:
Constant Field Values

CLIENTAUTH

public static final int CLIENTAUTH
See Also:
Constant Field Values

CODESIGNING

public static final int CODESIGNING
See Also:
Constant Field Values

EMAILPROTECTION

public static final int EMAILPROTECTION
See Also:
Constant Field Values

IPSECENDSYSTEM

public static final int IPSECENDSYSTEM
See Also:
Constant Field Values

IPSECTUNNEL

public static final int IPSECTUNNEL
See Also:
Constant Field Values

IPSECUSER

public static final int IPSECUSER
See Also:
Constant Field Values

TIMESTAMPING

public static final int TIMESTAMPING
See Also:
Constant Field Values

SMARTCARDLOGON

public static final int SMARTCARDLOGON
See Also:
Constant Field Values

OCSPSIGNING

public static final int OCSPSIGNING
See Also:
Constant Field Values

EXTENDEDKEYUSAGEOIDSTRINGS

public static final String[] EXTENDEDKEYUSAGEOIDSTRINGS

EXTENDEDKEYUSAGETEXTS

public static final String[] EXTENDEDKEYUSAGETEXTS

UPN

public static final String UPN
Microsoft altName for windows smart card logon

See Also:
Constant Field Values

UPN_OBJECTID

public static final String UPN_OBJECTID
ObjectID for upn altName for windows smart card logon

See Also:
Constant Field Values

GUID

public static final String GUID
Microsoft altName for windows domain controller guid

See Also:
Constant Field Values

GUID_OBJECTID

public static final String GUID_OBJECTID
ObjectID for upn altName for windows domain controller guid

See Also:
Constant Field Values
Constructor Detail

CertificateInfo

public CertificateInfo(X509Certificate certificate)
Method Detail

getSubjectAltName

public String getSubjectAltName()

getGuidAltName

public static String getGuidAltName(X509Certificate cert)
                             throws IOException,
                                    CertificateParsingException
Gets the Microsoft specific GUID altName, that is encoded as an octect string.

Parameters:
cert - certificate containing the extension
Returns:
String with the hex-encoded GUID byte array or null if the altName does not exist
Throws:
IOException
CertificateParsingException

getUPNAltName

public static String getUPNAltName(X509Certificate cert)
                            throws IOException,
                                   CertificateParsingException
Gets the Microsoft specific UPN altName.

Parameters:
cert - certificate containing the extension
Returns:
String with the UPN name or null if the altName does not exist
Throws:
IOException
CertificateParsingException

getKeyUsageAsText

public static String getKeyUsageAsText(X509Certificate certificate)

getExtendedKeyUsageAsText

public static String getExtendedKeyUsageAsText(X509Certificate certificate)

getSubjectAsShortText

public static String getSubjectAsShortText(X509Certificate certificate)

getIssuerAsShortText

public static String getIssuerAsShortText(X509Certificate certificate)

getDNAsShortText

public static String getDNAsShortText(Principal dn)

getNotBeforeAsText

public static String getNotBeforeAsText(X509Certificate certificate)

getNotBeforeAsFullText

public static String getNotBeforeAsFullText(X509Certificate certificate)

getNotAfterAsText

public static String getNotAfterAsText(X509Certificate certificate)

getNotAfterAsFullText

public static String getNotAfterAsFullText(X509Certificate certificate)

getPublicKeyInfo

public static String getPublicKeyInfo(PublicKey pk)

getSubjectAlternativeNames

public static List<String> getSubjectAlternativeNames(X509Certificate certificate)

getCDPAsText

public String getCDPAsText()

GeneralNameAsText

public static String GeneralNameAsText(org.bouncycastle.asn1.x509.GeneralName gn)


Copyright © 2009 eParapher Software Foundation. All Rights Reserved.