summaryrefslogtreecommitdiffstats
path: root/pki/base/common/src/com/netscape/cmscore/dbs/PublicKeyMapper.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/cmscore/dbs/PublicKeyMapper.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/cmscore/dbs/PublicKeyMapper.java')
-rw-r--r--pki/base/common/src/com/netscape/cmscore/dbs/PublicKeyMapper.java48
1 files changed, 25 insertions, 23 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 dafc13d8..f55248ee 100644
--- a/pki/base/common/src/com/netscape/cmscore/dbs/PublicKeyMapper.java
+++ b/pki/base/common/src/com/netscape/cmscore/dbs/PublicKeyMapper.java
@@ -17,6 +17,7 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cmscore.dbs;
+
import java.security.PublicKey;
import java.security.cert.X509Certificate;
import java.util.Enumeration;
@@ -31,14 +32,16 @@ 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 {
@@ -65,16 +68,18 @@ 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) {
@@ -84,11 +89,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) {
@@ -106,17 +111,14 @@ 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;
@@ -144,8 +146,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;
}