summaryrefslogtreecommitdiffstats
path: root/pki/base/common/src/com/netscape/cms/shares
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/shares
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/shares')
-rw-r--r--pki/base/common/src/com/netscape/cms/shares/OldJoinShares.java93
-rw-r--r--pki/base/common/src/com/netscape/cms/shares/OldShare.java58
2 files changed, 80 insertions, 71 deletions
diff --git a/pki/base/common/src/com/netscape/cms/shares/OldJoinShares.java b/pki/base/common/src/com/netscape/cms/shares/OldJoinShares.java
index 0377c2b3a..0c4dade84 100644
--- a/pki/base/common/src/com/netscape/cms/shares/OldJoinShares.java
+++ b/pki/base/common/src/com/netscape/cms/shares/OldJoinShares.java
@@ -23,9 +23,9 @@ import java.lang.reflect.Method;
import com.netscape.certsrv.kra.IJoinShares;
/**
- * Use Java's reflection API to leverage CMS's old Share and JoinShares
- * implementations.
- *
+ * Use Java's reflection API to leverage CMS's
+ * old Share and JoinShares implementations.
+ *
* @deprecated
* @version $Revision$ $Date$
*/
@@ -33,54 +33,59 @@ public class OldJoinShares implements IJoinShares {
public Object mOldImpl = null;
- public OldJoinShares() {
+ public OldJoinShares()
+ {
}
- public void initialize(int threshold) throws Exception {
- Class c = Class.forName("com.netscape.cmscore.shares.JoinShares");
- Class types[] = { int.class };
- Constructor con = c.getConstructor(types);
- Object params[] = { Integer.valueOf(threshold) };
- mOldImpl = con.newInstance(params);
+ public void initialize(int threshold) throws Exception
+ {
+ Class c = Class.forName("com.netscape.cmscore.shares.JoinShares");
+ Class types[] = { int.class };
+ Constructor con = c.getConstructor(types);
+ Object params[] = {Integer.valueOf(threshold)};
+ mOldImpl = con.newInstance(params);
}
- public void addShare(int shareNum, byte[] share) {
- try {
- Class types[] = { int.class, share.getClass() };
- Class c = mOldImpl.getClass();
- Method method = c.getMethod("addShare", types);
- Object params[] = { Integer.valueOf(shareNum), share };
- method.invoke(mOldImpl, params);
- } catch (Exception e) {
- }
+ public void addShare(int shareNum, byte[] share)
+ {
+ try {
+ Class types[] = { int.class, share.getClass() };
+ Class c = mOldImpl.getClass();
+ Method method = c.getMethod("addShare", types);
+ Object params[] = {Integer.valueOf(shareNum), share};
+ method.invoke(mOldImpl, params);
+ } catch (Exception e) {
+ }
}
- public int getShareCount() {
- if (mOldImpl == null)
- return -1;
- try {
- Class types[] = null;
- Class c = mOldImpl.getClass();
- Method method = c.getMethod("getShareCount", types);
- Object params[] = null;
- Integer result = (Integer) method.invoke(mOldImpl, params);
- return result.intValue();
- } catch (Exception e) {
- return -1;
- }
+ public int getShareCount()
+ {
+ if (mOldImpl == null)
+ return -1;
+ try {
+ Class types[] = null;
+ Class c = mOldImpl.getClass();
+ Method method = c.getMethod("getShareCount", types);
+ Object params[] = null;
+ Integer result = (Integer)method.invoke(mOldImpl, params);
+ return result.intValue();
+ } catch (Exception e) {
+ return -1;
+ }
}
- public byte[] recoverSecret() {
- if (mOldImpl == null)
- return null;
- try {
- Class types[] = null;
- Class c = mOldImpl.getClass();
- Method method = c.getMethod("recoverSecret", types);
- Object params[] = null;
- return (byte[]) method.invoke(mOldImpl, params);
- } catch (Exception e) {
- return null;
- }
+ public byte[] recoverSecret()
+ {
+ if (mOldImpl == null)
+ return null;
+ try {
+ Class types[] = null;
+ Class c = mOldImpl.getClass();
+ Method method = c.getMethod("recoverSecret", types);
+ Object params[] = null;
+ return (byte[])method.invoke(mOldImpl, params);
+ } catch (Exception e) {
+ return null;
+ }
}
}
diff --git a/pki/base/common/src/com/netscape/cms/shares/OldShare.java b/pki/base/common/src/com/netscape/cms/shares/OldShare.java
index cfd5c7099..4e92f76a0 100644
--- a/pki/base/common/src/com/netscape/cms/shares/OldShare.java
+++ b/pki/base/common/src/com/netscape/cms/shares/OldShare.java
@@ -23,41 +23,45 @@ import java.lang.reflect.Method;
import com.netscape.certsrv.kra.IShare;
/**
- * Use Java's reflection API to leverage CMS's old Share and JoinShares
- * implementations.
- *
+ * Use Java's reflection API to leverage CMS's
+ * old Share and JoinShares implementations.
+ *
* @deprecated
* @version $Revision$ $Date$
*/
-public class OldShare implements IShare {
+public class OldShare implements IShare
+{
public Object mOldImpl = null;
- public OldShare() {
+ public OldShare()
+ {
}
- public void initialize(byte[] secret, int threshold) throws Exception {
- try {
- Class c = Class.forName("com.netscape.cmscore.shares.Share");
- Class types[] = { secret.getClass(), int.class };
- Constructor cs[] = c.getConstructors();
- Constructor con = c.getConstructor(types);
- Object params[] = { secret, Integer.valueOf(threshold) };
- mOldImpl = con.newInstance(params);
- } catch (Exception e) {
- }
+ public void initialize(byte[] secret, int threshold) throws Exception
+ {
+ try {
+ Class c = Class.forName("com.netscape.cmscore.shares.Share");
+ Class types[] = { secret.getClass(), int.class };
+ Constructor cs[] = c.getConstructors();
+ Constructor con = c.getConstructor(types);
+ Object params[] = {secret, Integer.valueOf(threshold)};
+ mOldImpl = con.newInstance(params);
+ } catch (Exception e) {
+ }
}
- public byte[] createShare(int sharenumber) {
- if (mOldImpl == null)
- return null;
- try {
- Class types[] = { int.class };
- Class c = mOldImpl.getClass();
- Method method = c.getMethod("createShare", types);
- Object params[] = { Integer.valueOf(sharenumber) };
- return (byte[]) method.invoke(mOldImpl, params);
- } catch (Exception e) {
- return null;
- }
+ public byte[] createShare(int sharenumber)
+ {
+ if (mOldImpl == null)
+ return null;
+ try {
+ Class types[] = { int.class };
+ Class c = mOldImpl.getClass();
+ Method method = c.getMethod("createShare", types);
+ Object params[] = {Integer.valueOf(sharenumber)};
+ return (byte[])method.invoke(mOldImpl, params);
+ } catch (Exception e) {
+ return null;
+ }
}
}