Class LdapCertSubjPublisher
- java.lang.Object
-
- com.netscape.cms.publish.publishers.LdapCertSubjPublisher
-
- All Implemented Interfaces:
ILdapPlugin,ILdapPublisher
public class LdapCertSubjPublisher extends java.lang.Object implements ILdapPublisher
Interface for mapping a X509 certificate to a LDAP entry Publishes a certificate as binary and its subject name. there is one subject name value for each certificate.- Version:
- $Revision$, $Date$
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringLDAP_CERTSUBJNAME_ATTRstatic org.slf4j.Loggerloggerprotected java.lang.StringmCertAttrprotected IConfigStoremConfigprotected java.lang.StringmSubjNameAttr-
Fields inherited from interface com.netscape.certsrv.publish.ILdapPublisher
PROP_ENABLE, PROP_IMPLNAME, PROP_PREDICATE
-
-
Constructor Summary
Constructors Constructor Description LdapCertSubjPublisher()constructor using default certificate subject name and attribute for publishing subject name.LdapCertSubjPublisher(java.lang.String certAttr, java.lang.String subjNameAttr)constrcutor using specified certificate attribute and certificate subject name attribute.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetCertAttr()IConfigStoregetConfigStore()Return config store.java.util.Vector<java.lang.String>getDefaultParams()Returns the initial default parameters.java.lang.StringgetDescription()Returns the description of the publisher.java.lang.StringgetImplName()Returns the implementation name.java.util.Vector<java.lang.String>getInstanceParams()Returns the current instance parameters.java.lang.StringgetSubjNameAttr()voidinit(IConfigStore config)Initialize from config store.voidpublish(netscape.ldap.LDAPConnection conn, java.lang.String dn, java.lang.Object certObj)publish a user certificate Adds the cert to the multi-valued certificate attribute as a DER encoded binary blob.voidsetCertAttr(java.lang.String certAttr)voidsetSubjNameAttr(java.lang.String subjNameAttr)voidunpublish(netscape.ldap.LDAPConnection conn, java.lang.String dn, java.lang.Object certObj)deletes the certificate from the list of certificates.
-
-
-
Field Detail
-
logger
public static org.slf4j.Logger logger
-
LDAP_CERTSUBJNAME_ATTR
public static final java.lang.String LDAP_CERTSUBJNAME_ATTR
- See Also:
- Constant Field Values
-
mCertAttr
protected java.lang.String mCertAttr
-
mSubjNameAttr
protected java.lang.String mSubjNameAttr
-
mConfig
protected IConfigStore mConfig
-
-
Constructor Detail
-
LdapCertSubjPublisher
public LdapCertSubjPublisher()
constructor using default certificate subject name and attribute for publishing subject name.
-
LdapCertSubjPublisher
public LdapCertSubjPublisher(java.lang.String certAttr, java.lang.String subjNameAttr)constrcutor using specified certificate attribute and certificate subject name attribute.
-
-
Method Detail
-
getImplName
public java.lang.String getImplName()
Description copied from interface:ILdapPublisherReturns the implementation name.- Specified by:
getImplNamein interfaceILdapPublisher
-
getDescription
public java.lang.String getDescription()
Description copied from interface:ILdapPublisherReturns the description of the publisher.- Specified by:
getDescriptionin interfaceILdapPublisher
-
getInstanceParams
public java.util.Vector<java.lang.String> getInstanceParams()
Description copied from interface:ILdapPublisherReturns the current instance parameters.- Specified by:
getInstanceParamsin interfaceILdapPublisher
-
getDefaultParams
public java.util.Vector<java.lang.String> getDefaultParams()
Description copied from interface:ILdapPublisherReturns the initial default parameters.- Specified by:
getDefaultParamsin interfaceILdapPublisher
-
getConfigStore
public IConfigStore getConfigStore()
Description copied from interface:ILdapPluginReturn config store.- Specified by:
getConfigStorein interfaceILdapPlugin
-
init
public void init(IConfigStore config) throws EBaseException
Description copied from interface:ILdapPluginInitialize from config store.- Specified by:
initin interfaceILdapPlugin- Parameters:
config- the configuration store to initialize from.- Throws:
ELdapException- initialization failed due to Ldap error.EBaseException- initialization failed.
-
getCertAttr
public java.lang.String getCertAttr()
-
getSubjNameAttr
public java.lang.String getSubjNameAttr()
-
setSubjNameAttr
public void setSubjNameAttr(java.lang.String subjNameAttr)
-
setCertAttr
public void setCertAttr(java.lang.String certAttr)
-
publish
public void publish(netscape.ldap.LDAPConnection conn, java.lang.String dn, java.lang.Object certObj) throws ELdapExceptionpublish a user certificate Adds the cert to the multi-valued certificate attribute as a DER encoded binary blob. Does not check if cert already exists. Then adds the subject name of the cert to the subject name attribute.- Specified by:
publishin interfaceILdapPublisher- Parameters:
conn- the LDAP connectiondn- dn of the entry to publish the certificatecertObj- the certificate object.- Throws:
ELdapException- if cert or subject name already exists, if cert encoding fails, if getting cert subject name fails. Use ELdapException.getException() to find underlying exception.
-
unpublish
public void unpublish(netscape.ldap.LDAPConnection conn, java.lang.String dn, java.lang.Object certObj) throws ELdapExceptiondeletes the certificate from the list of certificates. does not check if certificate is already there. also takes out the subject name if no other certificate remain with the same subject name.- Specified by:
unpublishin interfaceILdapPublisher- Parameters:
conn- the Ldap connection (null for non-LDAP publishing)dn- dn of the ldap entry to unpublish cert (null for non-LDAP publishing)certObj- object to unpublish (java.security.cert.X509Certificate)- Throws:
ELdapException- unpublish failed.
-
-