summaryrefslogtreecommitdiffstats
path: root/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCertCompsMap.java
diff options
context:
space:
mode:
authorAde Lee <alee@redhat.com>2011-12-08 21:15:59 -0500
committerAde Lee <alee@redhat.com>2011-12-08 21:15:59 -0500
commit171aaece4f23709d33d180cf36eb3af5e454b0c9 (patch)
tree1485f9f0a7bd10de4ff25030db575dbb8dafae74 /pki/base/common/src/com/netscape/cms/publish/mappers/LdapCertCompsMap.java
parentadad2fcee8a29fdb82376fbce07dedb11fccc182 (diff)
downloadpki-171aaece4f23709d33d180cf36eb3af5e454b0c9.tar.gz
pki-171aaece4f23709d33d180cf36eb3af5e454b0c9.tar.xz
pki-171aaece4f23709d33d180cf36eb3af5e454b0c9.zip
Revert "Formatting"
This reverts commit 32150d3ee32f8ac27118af7c792794b538c78a2f.
Diffstat (limited to 'pki/base/common/src/com/netscape/cms/publish/mappers/LdapCertCompsMap.java')
-rw-r--r--pki/base/common/src/com/netscape/cms/publish/mappers/LdapCertCompsMap.java99
1 files changed, 52 insertions, 47 deletions
diff --git a/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCertCompsMap.java b/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCertCompsMap.java
index 8b7a1dbe8..b8cc06f77 100644
--- a/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCertCompsMap.java
+++ b/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCertCompsMap.java
@@ -17,6 +17,7 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cms.publish.mappers;
+
import java.security.cert.CRLException;
import java.security.cert.CertificateEncodingException;
import java.security.cert.X509Certificate;
@@ -33,19 +34,22 @@ import com.netscape.certsrv.logging.ILogger;
import com.netscape.certsrv.publish.ILdapMapper;
import com.netscape.certsrv.request.IRequest;
-/**
- * Maps a X509 certificate to a LDAP entry using AVAs in the certificate's
- * subject name to form the ldap search dn and filter. Takes a optional root
- * search dn. The DN comps are used to form a LDAP entry to begin a subtree
- * search. The filter comps are used to form a search filter for the subtree. If
- * none of the DN comps matched, baseDN is used for the subtree. If the baseDN
- * is null and none of the DN comps matched, it is an error. If none of the DN
- * comps and filter comps matched, it is an error. If just the filter comps is
- * null, a base search is performed.
- *
+
+/**
+ * Maps a X509 certificate to a LDAP entry using AVAs in the certificate's
+ * subject name to form the ldap search dn and filter.
+ * Takes a optional root search dn.
+ * The DN comps are used to form a LDAP entry to begin a subtree search.
+ * The filter comps are used to form a search filter for the subtree.
+ * If none of the DN comps matched, baseDN is used for the subtree.
+ * If the baseDN is null and none of the DN comps matched, it is an error.
+ * If none of the DN comps and filter comps matched, it is an error.
+ * If just the filter comps is null, a base search is performed.
+ *
* @version $Revision$, $Date$
*/
-public class LdapCertCompsMap extends LdapDNCompsMap implements ILdapMapper {
+public class LdapCertCompsMap
+ extends LdapDNCompsMap implements ILdapMapper {
ILogger mLogger = CMS.getLogger();
public LdapCertCompsMap() {
@@ -53,22 +57,22 @@ public class LdapCertCompsMap extends LdapDNCompsMap implements ILdapMapper {
// via configuration
}
- /**
+ /**
* Constructor.
+ *
+ * The DN comps are used to form a LDAP entry to begin a subtree search.
+ * The filter comps are used to form a search filter for the subtree.
+ * If none of the DN comps matched, baseDN is used for the subtree.
+ * If the baseDN is null and none of the DN comps matched, it is an error.
+ * If none of the DN comps and filter comps matched, it is an error.
+ * If just the filter comps is null, a base search is performed.
*
- * The DN comps are used to form a LDAP entry to begin a subtree search. The
- * filter comps are used to form a search filter for the subtree. If none of
- * the DN comps matched, baseDN is used for the subtree. If the baseDN is
- * null and none of the DN comps matched, it is an error. If none of the DN
- * comps and filter comps matched, it is an error. If just the filter comps
- * is null, a base search is performed.
- *
- * @param baseDN The base DN.
+ * @param baseDN The base DN.
* @param dnComps Components to form the LDAP base dn for search.
* @param filterComps Components to form the LDAP search filter.
*/
public LdapCertCompsMap(String baseDN, ObjectIdentifier[] dnComps,
- ObjectIdentifier[] filterComps) {
+ ObjectIdentifier[] filterComps) {
init(baseDN, dnComps, filterComps);
}
@@ -95,35 +99,40 @@ public class LdapCertCompsMap extends LdapDNCompsMap implements ILdapMapper {
/**
* constructor using non-standard certificate attribute.
*/
- public LdapCertCompsMap(String certAttr, String baseDN,
- ObjectIdentifier[] dnComps, ObjectIdentifier[] filterComps) {
+ public LdapCertCompsMap(String certAttr, String baseDN,
+ ObjectIdentifier[] dnComps,
+ ObjectIdentifier[] filterComps) {
super(certAttr, baseDN, dnComps, filterComps);
}
protected void init(String baseDN, ObjectIdentifier[] dnComps,
- ObjectIdentifier[] filterComps) {
+ ObjectIdentifier[] filterComps) {
super.init(baseDN, dnComps, filterComps);
}
/**
- * Maps a certificate to LDAP entry. Uses DN components and filter
- * components to form a DN and filter for a LDAP search. If the formed DN is
- * null the baseDN will be used. If the formed DN is null and baseDN is null
- * an error is thrown. If the filter is null a base search is performed. If
- * both are null an error is thrown.
+ * Maps a certificate to LDAP entry.
+ * Uses DN components and filter components to form a DN and
+ * filter for a LDAP search.
+ * If the formed DN is null the baseDN will be used.
+ * If the formed DN is null and baseDN is null an error is thrown.
+ * If the filter is null a base search is performed.
+ * If both are null an error is thrown.
*
* @param conn - the LDAP connection.
* @param obj - the X509Certificate.
*/
- public String map(LDAPConnection conn, Object obj) throws ELdapException {
+ public String
+ map(LDAPConnection conn, Object obj)
+ throws ELdapException {
if (conn == null)
return null;
try {
X509Certificate cert = (X509Certificate) obj;
String result = null;
// form dn and filter for search.
- X500Name subjectDN = (X500Name) ((X509Certificate) cert)
- .getSubjectDN();
+ X500Name subjectDN =
+ (X500Name) ((X509Certificate) cert).getSubjectDN();
CMS.debug("LdapCertCompsMap: " + subjectDN.toString());
@@ -132,16 +141,15 @@ public class LdapCertCompsMap extends LdapDNCompsMap implements ILdapMapper {
result = super.map(conn, subjectDN, certbytes);
return result;
} catch (CertificateEncodingException e) {
- log(ILogger.LL_FAILURE,
- CMS.getLogMessage("PUBLISH_CANT_DECODE_CERT", e.toString()));
- throw new ELdapException(CMS.getUserMessage(
- "CMS_LDAP_GET_DER_ENCODED_CERT_FAILED", e.toString()));
+ log(ILogger.LL_FAILURE, CMS.getLogMessage("PUBLISH_CANT_DECODE_CERT", e.toString()));
+ throw new ELdapException(
+ CMS.getUserMessage("CMS_LDAP_GET_DER_ENCODED_CERT_FAILED", e.toString()));
} catch (ClassCastException e) {
try {
X509CRLImpl crl = (X509CRLImpl) obj;
String result = null;
- X500Name issuerDN = (X500Name) ((X509CRLImpl) crl)
- .getIssuerDN();
+ X500Name issuerDN =
+ (X500Name) ((X509CRLImpl) crl).getIssuerDN();
CMS.debug("LdapCertCompsMap: " + issuerDN.toString());
@@ -150,27 +158,24 @@ public class LdapCertCompsMap extends LdapDNCompsMap implements ILdapMapper {
result = super.map(conn, issuerDN, crlbytes);
return result;
} catch (CRLException ex) {
- log(ILogger.LL_FAILURE,
- CMS.getLogMessage("PUBLISH_CANT_DECODE_CRL",
- ex.toString()));
- throw new ELdapException(CMS.getUserMessage(
- "CMS_LDAP_GET_DER_ENCODED_CRL_FAILED", ex.toString()));
+ log(ILogger.LL_FAILURE, CMS.getLogMessage("PUBLISH_CANT_DECODE_CRL", ex.toString()));
+ throw new ELdapException(CMS.getUserMessage("CMS_LDAP_GET_DER_ENCODED_CRL_FAILED", ex.toString()));
} catch (ClassCastException ex) {
- log(ILogger.LL_FAILURE,
- CMS.getLogMessage("PUBLISH_NOT_SUPPORTED_OBJECT"));
+ log(ILogger.LL_FAILURE, CMS.getLogMessage("PUBLISH_NOT_SUPPORTED_OBJECT"));
return null;
}
}
}
public String map(LDAPConnection conn, IRequest req, Object obj)
- throws ELdapException {
+ throws ELdapException {
return map(conn, obj);
}
private void log(int level, String msg) {
mLogger.log(ILogger.EV_SYSTEM, ILogger.S_LDAP, level,
- "LdapCertCompsMap: " + msg);
+ "LdapCertCompsMap: " + msg);
}
}
+