summaryrefslogtreecommitdiffstats
path: root/pki/base/common/src/com/netscape/cmscore/dbs/PublicKeyMapper.java
diff options
context:
space:
mode:
Diffstat (limited to 'pki/base/common/src/com/netscape/cmscore/dbs/PublicKeyMapper.java')
-rw-r--r--pki/base/common/src/com/netscape/cmscore/dbs/PublicKeyMapper.java48
1 files changed, 23 insertions, 25 deletions
diff --git a/pki/base/common/src/com/netscape/cmscore/dbs/PublicKeyMapper.java b/pki/base/common/src/com/netscape/cmscore/dbs/PublicKeyMapper.java
index f55248ee..dafc13d8 100644
--- a/pki/base/common/src/com/netscape/cmscore/dbs/PublicKeyMapper.java
+++ b/pki/base/common/src/com/netscape/cmscore/dbs/PublicKeyMapper.java
@@ -17,7 +17,6 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cmscore.dbs;
-
import java.security.PublicKey;
import java.security.cert.X509Certificate;
import java.util.Enumeration;
@@ -32,16 +31,14 @@ import com.netscape.certsrv.dbs.IDBAttrMapper;
import com.netscape.certsrv.dbs.IDBObj;
import com.netscape.certsrv.logging.ILogger;
import com.netscape.cmscore.cert.CertUtils;
-
/**
- * A class represents an attribute mapper that maps
- * a public key data into LDAP attribute and
- * vice versa.
+ * A class represents an attribute mapper that maps a public key data into LDAP
+ * attribute and vice versa.
* <P>
- *
+ *
* @author thomask
- * @version $Revision$, $Date$
+ * @version $Revision$, $Date$
*/
public class PublicKeyMapper implements IDBAttrMapper {
@@ -68,18 +65,16 @@ public class PublicKeyMapper implements IDBAttrMapper {
/**
* Maps object to ldap attribute set.
*/
- public void mapObjectToLDAPAttributeSet(IDBObj parent,
- String name, Object obj, LDAPAttributeSet attrs)
- throws EBaseException {
+ public void mapObjectToLDAPAttributeSet(IDBObj parent, String name,
+ Object obj, LDAPAttributeSet attrs) throws EBaseException {
attrs.add(new LDAPAttribute(mLdapName, (byte[]) obj));
}
/**
- * Maps LDAP attributes into object, and put the object
- * into 'parent'.
+ * Maps LDAP attributes into object, and put the object into 'parent'.
*/
- public void mapLDAPAttributeSetToObject(LDAPAttributeSet attrs,
- String name, IDBObj parent) throws EBaseException {
+ public void mapLDAPAttributeSetToObject(LDAPAttributeSet attrs,
+ String name, IDBObj parent) throws EBaseException {
LDAPAttribute attr = attrs.getAttribute(mLdapName);
if (attr == null) {
@@ -89,11 +84,11 @@ public class PublicKeyMapper implements IDBAttrMapper {
}
/**
- * Maps search filters into LDAP search filter. It knows
- * how to extract public key from the certificate.
+ * Maps search filters into LDAP search filter. It knows how to extract
+ * public key from the certificate.
*/
- public String mapSearchFilter(String name, String op,
- String value) throws EBaseException {
+ public String mapSearchFilter(String name, String op, String value)
+ throws EBaseException {
int i = value.indexOf("#");
if (i != -1) {
@@ -111,14 +106,17 @@ public class PublicKeyMapper implements IDBAttrMapper {
return mLdapName + op + escapeBinaryData(pub);
} catch (Exception e) {
- /*LogDoc
- *
+ /*
+ * LogDoc
+ *
* @phase Maps search filters into LDAP search filter
+ *
* @message PublicKeyMapper: <exception thrown>
*/
- mLogger.log(ILogger.EV_SYSTEM, ILogger.S_DB, ILogger.LL_FAILURE,
- CMS.getLogMessage("CMSCORE_DBS_PUBLICKEY_MAPPER_ERROR",
- e.toString()));
+ mLogger.log(ILogger.EV_SYSTEM, ILogger.S_DB,
+ ILogger.LL_FAILURE, CMS.getLogMessage(
+ "CMSCORE_DBS_PUBLICKEY_MAPPER_ERROR",
+ e.toString()));
}
}
return mLdapName + op + value;
@@ -146,8 +144,8 @@ public class PublicKeyMapper implements IDBAttrMapper {
for (int i = 0; i < data.length; i++) {
int v = 0xff & data[i];
- result = result + "\\" + (v < 16 ? "0" : "") +
- Integer.toHexString(v);
+ result = result + "\\" + (v < 16 ? "0" : "")
+ + Integer.toHexString(v);
}
return result;
}