Package com.sun.identity.security.cert
Class AMCertStore
- java.lang.Object
-
- com.sun.identity.security.cert.AMCertStore
-
- Direct Known Subclasses:
AMCRLStore
public class AMCertStore extends Object
The class is used to manage certificate store in LDAP server This class does get certificate with specified attr name and value. This class should be used in order to manage certificate store in LDAP
-
-
Field Summary
Fields Modifier and Type Field Description static StringCACERTIFICATEstatic StringCACERTIFICATE_BINARYprotected X509Certificatecertificateprotected static CertificateFactorycfprotected org.forgerock.opendj.ldap.ConnectionFactoryldapconnprotected AMLDAPCertStoreParametersstoreParamstatic StringUSERCERTIFICATEstatic StringUSERCERTIFICATE_BINARY
-
Constructor Summary
Constructors Constructor Description AMCertStore(AMLDAPCertStoreParameters param)Class AMCertStore is special cased Certificate store for LDAP.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description X509CertificategetCertificate()Return matched certificate from ldap certificate storestatic X509CertificategetCertificate(AMLDAPCertStoreParameters ldapParam, String attrName, String attrValue)Return X509 Certificate if the ldap entry has oneX509CertificategetCertificate(X509Certificate cert)Return matched certificate from ldap certificate storestatic X509CertificategetIssuerCertificate(AMLDAPCertStoreParameters ldapParam, X509Certificate cert, String attrName)Return Issuer Certificate if the ldap entry has onestatic StringgetIssuerDN(X509Certificate certificate)Return value of certificate Issuer DN.static X509CertificategetRegisteredCertificate(AMLDAPCertStoreParameters ldapParam, X509Certificate cert, String attrName)Return X509 Certificate if the ldap entry has the same onestatic StringgetSubjectDN(X509Certificate certificate)Return value of certificate subject DN.static booleanisRootCA(X509Certificate cert)Return true if it is self signed ROOT CAstatic AMLDAPCertStoreParameterssetLdapStoreParam(String serverHost, int serverPort, String principleUser, String principlePasswd, String startSearchLoc, String uriParamsCRL, boolean isSSL)Return ldapParam object has all config paramsstatic StringsetSearchFilter(String attrName, String attrValue)Return value of certificate subject DN
-
-
-
Field Detail
-
USERCERTIFICATE
public static final String USERCERTIFICATE
- See Also:
- Constant Field Values
-
USERCERTIFICATE_BINARY
public static final String USERCERTIFICATE_BINARY
- See Also:
- Constant Field Values
-
CACERTIFICATE
public static final String CACERTIFICATE
- See Also:
- Constant Field Values
-
CACERTIFICATE_BINARY
public static final String CACERTIFICATE_BINARY
- See Also:
- Constant Field Values
-
storeParam
protected AMLDAPCertStoreParameters storeParam
-
ldapconn
protected org.forgerock.opendj.ldap.ConnectionFactory ldapconn
-
certificate
protected X509Certificate certificate
-
cf
protected static CertificateFactory cf
-
-
Constructor Detail
-
AMCertStore
public AMCertStore(AMLDAPCertStoreParameters param)
Class AMCertStore is special cased Certificate store for LDAP. A AMCertStore instance has to have all the information for ldap.- Parameters:
param-
-
-
Method Detail
-
getCertificate
public X509Certificate getCertificate(X509Certificate cert)
Return matched certificate from ldap certificate store- Parameters:
cert-
-
getCertificate
public X509Certificate getCertificate()
Return matched certificate from ldap certificate store
-
getIssuerDN
public static String getIssuerDN(X509Certificate certificate)
Return value of certificate Issuer DN.- Parameters:
certificate-- Returns:
- The Issuer's DN as String.
-
getSubjectDN
public static String getSubjectDN(X509Certificate certificate) throws IOException
Return value of certificate subject DN.- Parameters:
certificate-- Returns:
- The Subject's DN as String.
- Throws:
IOException
-
setSearchFilter
public static String setSearchFilter(String attrName, String attrValue)
Return value of certificate subject DN- Parameters:
attrName-attrValue-- Returns:
- searchFilter
-
setLdapStoreParam
public static AMLDAPCertStoreParameters setLdapStoreParam(String serverHost, int serverPort, String principleUser, String principlePasswd, String startSearchLoc, String uriParamsCRL, boolean isSSL) throws Exception
Return ldapParam object has all config params- Parameters:
serverHost-serverPort-principleUser-principlePasswd-startSearchLoc-uriParamsCRL-isSSL-- Throws:
Exception
-
getIssuerCertificate
public static X509Certificate getIssuerCertificate(AMLDAPCertStoreParameters ldapParam, X509Certificate cert, String attrName)
Return Issuer Certificate if the ldap entry has one- Parameters:
ldapParam-cert-attrName-
-
getRegisteredCertificate
public static X509Certificate getRegisteredCertificate(AMLDAPCertStoreParameters ldapParam, X509Certificate cert, String attrName)
Return X509 Certificate if the ldap entry has the same one- Parameters:
ldapParam-cert-attrName-
-
getCertificate
public static X509Certificate getCertificate(AMLDAPCertStoreParameters ldapParam, String attrName, String attrValue)
Return X509 Certificate if the ldap entry has one- Parameters:
ldapParam-attrName-attrValue-
-
isRootCA
public static boolean isRootCA(X509Certificate cert)
Return true if it is self signed ROOT CA- Parameters:
cert-
-
-