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- the LDAP certificate store parameters used to configure this store
-
-
Method Detail
-
getCertificate
public X509Certificate getCertificate(X509Certificate cert)
Return matched certificate from ldap certificate store- Parameters:
cert- the certificate to match against the store
-
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- the certificate whose issuer DN is returned- Returns:
- The Issuer's DN as String.
-
getSubjectDN
public static String getSubjectDN(X509Certificate certificate) throws IOException
Return value of certificate subject DN.- Parameters:
certificate- the certificate whose subject DN is returned- 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- the attribute name to match in the search filterattrValue- the attribute value to match in the search filter- 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- the LDAP server host nameserverPort- the LDAP server portprincipleUser- the bind DN used to authenticate to the LDAP serverprinciplePasswd- the bind password used to authenticate to the LDAP serverstartSearchLoc- the base DN at which to start the searchuriParamsCRL- the URI parameters used when retrieving CRLsisSSL- true if the connection to the LDAP server should use SSL- Throws:
Exception
-
getIssuerCertificate
public static X509Certificate getIssuerCertificate(AMLDAPCertStoreParameters ldapParam, X509Certificate cert, String attrName)
Return Issuer Certificate if the ldap entry has one- Parameters:
ldapParam- the LDAP certificate store parameters used to connect to the storecert- the certificate whose issuer certificate is looked upattrName- the attribute name used to match the issuer certificate
-
getRegisteredCertificate
public static X509Certificate getRegisteredCertificate(AMLDAPCertStoreParameters ldapParam, X509Certificate cert, String attrName)
Return X509 Certificate if the ldap entry has the same one- Parameters:
ldapParam- the LDAP certificate store parameters used to connect to the storecert- the certificate to look up and compare against the storeattrName- the attribute name used to match the certificate
-
getCertificate
public static X509Certificate getCertificate(AMLDAPCertStoreParameters ldapParam, String attrName, String attrValue)
Return X509 Certificate if the ldap entry has one- Parameters:
ldapParam- the LDAP certificate store parameters used to connect to the storeattrName- the attribute name to match in the search filterattrValue- the attribute value to match in the search filter
-
isRootCA
public static boolean isRootCA(X509Certificate cert)
Return true if it is self signed ROOT CA- Parameters:
cert- the certificate to test for being a self-signed root CA
-
-