summaryrefslogtreecommitdiffstats
path: root/base/kra
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-04-05 15:08:18 -0500
committerEndi Sukma Dewata <edewata@redhat.com>2012-04-09 10:22:03 -0500
commit3f24e55923fc986af4c6a08b2b8d45704a905627 (patch)
tree716415853b5676b801f6707634305b59b9af8603 /base/kra
parent7c7b9d023cd466c1771068badc020dab36beb553 (diff)
downloadpki-3f24e55923fc986af4c6a08b2b8d45704a905627.tar.gz
pki-3f24e55923fc986af4c6a08b2b8d45704a905627.tar.xz
pki-3f24e55923fc986af4c6a08b2b8d45704a905627.zip
Removed unnecessary type casts.
Unnecessary type casts have been removed using Eclipse Quick Fix. Ticket #134
Diffstat (limited to 'base/kra')
-rw-r--r--base/kra/src/com/netscape/kra/EnrollmentService.java5
-rw-r--r--base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java8
-rw-r--r--base/kra/src/com/netscape/kra/NetkeyKeygenService.java2
-rw-r--r--base/kra/src/com/netscape/kra/RecoveryService.java2
-rw-r--r--base/kra/src/com/netscape/kra/SecurityDataRecoveryService.java2
-rw-r--r--base/kra/src/com/netscape/kra/StorageKeyUnit.java3
-rw-r--r--base/kra/src/com/netscape/kra/TokenKeyRecoveryService.java4
7 files changed, 12 insertions, 14 deletions
diff --git a/base/kra/src/com/netscape/kra/EnrollmentService.java b/base/kra/src/com/netscape/kra/EnrollmentService.java
index 1b6ffcebd..2f3e1dd7a 100644
--- a/base/kra/src/com/netscape/kra/EnrollmentService.java
+++ b/base/kra/src/com/netscape/kra/EnrollmentService.java
@@ -212,9 +212,8 @@ public class EnrollmentService implements IService {
}
} else {
// profile-based request
- PKIArchiveOptions options = (PKIArchiveOptions)
- toPKIArchiveOptions(
- request.getExtDataInByteArray(IEnrollProfile.REQUEST_ARCHIVE_OPTIONS));
+ PKIArchiveOptions options = toPKIArchiveOptions(
+ request.getExtDataInByteArray(IEnrollProfile.REQUEST_ARCHIVE_OPTIONS));
aOpts = new PKIArchiveOptionsContainer[1];
aOpts[0] = new PKIArchiveOptionsContainer(options,
diff --git a/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java b/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java
index 41b5fdae8..09f765877 100644
--- a/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java
+++ b/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java
@@ -608,7 +608,7 @@ public class KeyRecoveryAuthority implements IAuthority, IKeyService, IKeyRecove
public Hashtable<String, Object> getRecoveryParams(String recoveryID)
throws EBaseException {
- return (Hashtable<String, Object>) mRecoveryParams.get(recoveryID);
+ return mRecoveryParams.get(recoveryID);
}
public void createPk12(String recoveryID, byte[] pk12)
@@ -658,7 +658,7 @@ public class KeyRecoveryAuthority implements IAuthority, IKeyService, IKeyRecove
Hashtable<String, Object> h = getRecoveryParams(recoveryID);
@SuppressWarnings("unchecked")
Vector<Credential> dc = (Vector<Credential>) h.get(PARAM_CREDS);
- Object lock = (Object) h.get(PARAM_LOCK);
+ Object lock = h.get(PARAM_LOCK);
synchronized (lock) {
while (dc.size() < getNoOfRequiredAgents()) {
@@ -712,7 +712,7 @@ public class KeyRecoveryAuthority implements IAuthority, IKeyService, IKeyRecove
Hashtable<String, Object> h = getRecoveryParams(recoveryID);
@SuppressWarnings("unchecked")
Vector<Credential> dc = (Vector<Credential>) h.get(PARAM_CREDS);
- Object lock = (Object) h.get(PARAM_LOCK);
+ Object lock = h.get(PARAM_LOCK);
synchronized (lock) {
verifyCredential(dc, uid, pwd);
@@ -1500,7 +1500,7 @@ public class KeyRecoveryAuthority implements IAuthority, IKeyService, IKeyRecove
}
public Hashtable<String, Object> getVolatileRequest(RequestId id) {
- return (Hashtable<String, Object>) mVolatileRequests.get(id.toString());
+ return mVolatileRequests.get(id.toString());
}
public void destroyVolatileRequest(RequestId id) {
diff --git a/base/kra/src/com/netscape/kra/NetkeyKeygenService.java b/base/kra/src/com/netscape/kra/NetkeyKeygenService.java
index 017538bd5..1fdf9f74e 100644
--- a/base/kra/src/com/netscape/kra/NetkeyKeygenService.java
+++ b/base/kra/src/com/netscape/kra/NetkeyKeygenService.java
@@ -452,7 +452,7 @@ public class NetkeyKeygenService implements IService {
CMS.debug("NetkeyKeygenService: got key wrapper");
CMS.debug("NetkeyKeygenService: key transport key is on slot: " + sk.getOwningToken().getName());
- symWrap.initWrap((SymmetricKey) sk, algParam);
+ symWrap.initWrap(sk, algParam);
byte wrapped[] = symWrap.wrap((PrivateKey) privKey);
/*
CMS.debug("NetkeyKeygenService: wrap called");
diff --git a/base/kra/src/com/netscape/kra/RecoveryService.java b/base/kra/src/com/netscape/kra/RecoveryService.java
index 80f2fc711..135f55b59 100644
--- a/base/kra/src/com/netscape/kra/RecoveryService.java
+++ b/base/kra/src/com/netscape/kra/RecoveryService.java
@@ -412,7 +412,7 @@ public class RecoveryService implements IService {
keyRecord.getAlgorithm(),
iv,
pri,
- (PublicKey) pubkey);
+ pubkey);
if (privKey == null) {
mKRA.log(ILogger.LL_FAILURE, CMS.getLogMessage("CMSCORE_KRA_PRIVATE_KEY_NOT_FOUND"));
diff --git a/base/kra/src/com/netscape/kra/SecurityDataRecoveryService.java b/base/kra/src/com/netscape/kra/SecurityDataRecoveryService.java
index f96ece890..cec1ea434 100644
--- a/base/kra/src/com/netscape/kra/SecurityDataRecoveryService.java
+++ b/base/kra/src/com/netscape/kra/SecurityDataRecoveryService.java
@@ -305,7 +305,7 @@ public class SecurityDataRecoveryService implements IService {
throw new NoSuchAlgorithmException("Key generation algorithm" +
" is not a PBE algorithm");
}
- PBEAlgorithm pbeAlg = (PBEAlgorithm) keyGenAlg;
+ PBEAlgorithm pbeAlg = keyGenAlg;
KeyGenerator kg = token.getKeyGenerator(keyGenAlg);
PBEKeyGenParams pbekgParams = new PBEKeyGenParams(
diff --git a/base/kra/src/com/netscape/kra/StorageKeyUnit.java b/base/kra/src/com/netscape/kra/StorageKeyUnit.java
index 510e2f328..3d679e3d8 100644
--- a/base/kra/src/com/netscape/kra/StorageKeyUnit.java
+++ b/base/kra/src/com/netscape/kra/StorageKeyUnit.java
@@ -942,8 +942,7 @@ public class StorageKeyUnit extends EncryptionUnit implements
while (e.hasMoreElements()) {
String next = e.nextElement();
- j.addShare(Integer.parseInt(next) + 1,
- (byte[]) v.get(next));
+ j.addShare(Integer.parseInt(next) + 1, v.get(next));
}
try {
byte secret[] = j.recoverSecret();
diff --git a/base/kra/src/com/netscape/kra/TokenKeyRecoveryService.java b/base/kra/src/com/netscape/kra/TokenKeyRecoveryService.java
index 298988360..30a23594c 100644
--- a/base/kra/src/com/netscape/kra/TokenKeyRecoveryService.java
+++ b/base/kra/src/com/netscape/kra/TokenKeyRecoveryService.java
@@ -108,7 +108,7 @@ public class TokenKeyRecoveryService implements IService {
ByteArrayOutputStream out = new ByteArrayOutputStream(s.length());
for (int i = 0; i < s.length(); i++) {
- int c = (int) s.charAt(i);
+ int c = s.charAt(i);
if (c == '+') {
out.write(' ');
@@ -290,7 +290,7 @@ public class TokenKeyRecoveryService implements IService {
String cert = normalizeCertStr(cert_s);
java.security.cert.X509Certificate x509cert = null;
try {
- x509cert = (java.security.cert.X509Certificate) Cert.mapCert(cert);
+ x509cert = Cert.mapCert(cert);
if (x509cert == null) {
CMS.debug("cert mapping failed");
request.setExtData(IRequest.RESULT, Integer.valueOf(5));