org.freshcookies.security.cert
Class CertificateDN

java.lang.Object
  extended by org.freshcookies.security.cert.CertificateDN
All Implemented Interfaces:
java.security.Principal

public final class CertificateDN
extends java.lang.Object
implements java.security.Principal

Lightweight wrapper object for an X.509 certificate distinguished name.


Constructor Summary
CertificateDN(java.security.Principal dn)
          Constructs a new CertificateDN by parsing a supplied Principal from a certificate, such as X509Certificate.getSubjectDN() or X509Certificate.getIssuerDN().
 
Method Summary
 java.lang.String getCommonName()
          Returns the common name
 java.lang.String getCountry()
          Returns the country.
 java.lang.String getDomainComponent()
          Returns the domain component.
 java.lang.String getEmail()
          Returns the email.
 java.lang.String getLocality()
          Returns the locality.
 java.lang.String getName()
          Returns the distinguished name.
 java.lang.String getOrganization()
          Returns the organization.
 java.lang.String getOrganizationalUnit()
          Returns the organizational unit.
 java.lang.String getState()
          Returns the state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.security.Principal
equals, hashCode, toString
 

Constructor Detail

CertificateDN

public CertificateDN(java.security.Principal dn)
Constructs a new CertificateDN by parsing a supplied Principal from a certificate, such as X509Certificate.getSubjectDN() or X509Certificate.getIssuerDN().

Parameters:
dn - a Principal representing a certificate distinguished name
Method Detail

getCommonName

public final java.lang.String getCommonName()
Returns the common name

Returns:
the common name

getCountry

public final java.lang.String getCountry()
Returns the country.

Returns:
the country

getDomainComponent

public final java.lang.String getDomainComponent()
Returns the domain component.

Returns:
the domain component

getEmail

public final java.lang.String getEmail()
Returns the email.

Returns:
the email

getLocality

public final java.lang.String getLocality()
Returns the locality.

Returns:
the locality

getName

public final java.lang.String getName()
Returns the distinguished name.

Specified by:
getName in interface java.security.Principal
Returns:
the distinguished name.

getOrganization

public final java.lang.String getOrganization()
Returns the organization.

Returns:
the organization

getOrganizationalUnit

public final java.lang.String getOrganizationalUnit()
Returns the organizational unit.

Returns:
the organizational unit

getState

public final java.lang.String getState()
Returns the state.

Returns:
the state