Class LdapCertSubjPublisher
java.lang.Object
com.netscape.cms.publish.publishers.LdapCertSubjPublisher
- All Implemented Interfaces:
ILdapPlugin
,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
FieldsModifier and TypeFieldDescriptionstatic final String
static org.slf4j.Logger
protected String
protected ConfigStore
protected String
Fields inherited from interface com.netscape.certsrv.publish.ILdapPublisher
PROP_ENABLE, PROP_IMPLNAME, PROP_PREDICATE
-
Constructor Summary
ConstructorsConstructorDescriptionconstructor using default certificate subject name and attribute for publishing subject name.LdapCertSubjPublisher
(String certAttr, String subjNameAttr) constrcutor using specified certificate attribute and certificate subject name attribute. -
Method Summary
Modifier and TypeMethodDescriptionReturn config store.Returns the initial default parameters.Returns the description of the publisher.Returns the implementation name.Returns the current instance parameters.void
init
(ConfigStore config) Initialize from config store.void
publish a user certificate Adds the cert to the multi-valued certificate attribute as a DER encoded binary blob.void
setCertAttr
(String certAttr) void
setSubjNameAttr
(String subjNameAttr) void
deletes the certificate from the list of certificates.
-
Field Details
-
logger
public static org.slf4j.Logger logger -
LDAP_CERTSUBJNAME_ATTR
- See Also:
-
mCertAttr
-
mSubjNameAttr
-
mConfig
-
-
Constructor Details
-
LdapCertSubjPublisher
public LdapCertSubjPublisher()constructor using default certificate subject name and attribute for publishing subject name. -
LdapCertSubjPublisher
constrcutor using specified certificate attribute and certificate subject name attribute.
-
-
Method Details
-
getImplName
Description copied from interface:ILdapPublisher
Returns the implementation name.- Specified by:
getImplName
in interfaceILdapPublisher
-
getDescription
Description copied from interface:ILdapPublisher
Returns the description of the publisher.- Specified by:
getDescription
in interfaceILdapPublisher
-
getInstanceParams
Description copied from interface:ILdapPublisher
Returns the current instance parameters.- Specified by:
getInstanceParams
in interfaceILdapPublisher
-
getDefaultParams
Description copied from interface:ILdapPublisher
Returns the initial default parameters.- Specified by:
getDefaultParams
in interfaceILdapPublisher
-
getConfigStore
Description copied from interface:ILdapPlugin
Return config store.- Specified by:
getConfigStore
in interfaceILdapPlugin
-
init
Description copied from interface:ILdapPlugin
Initialize from config store.- Specified by:
init
in interfaceILdapPlugin
- Parameters:
config
- the configuration store to initialize from.- Throws:
ELdapException
- initialization failed due to Ldap error.EBaseException
- initialization failed.
-
getCertAttr
-
getSubjNameAttr
-
setSubjNameAttr
-
setCertAttr
-
publish
public void publish(netscape.ldap.LDAPConnection conn, String dn, Object certObj) throws ELdapException publish 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:
publish
in 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, String dn, Object certObj) throws ELdapException deletes 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:
unpublish
in 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.
-