[jboss-cvs] JBossAS SVN: r103597 - projects/security/security-jboss-sx/branches/Branch_2_0/jbosssx/src/main/java/org/jboss/crypto.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Apr 6 17:12:00 EDT 2010
Author: anil.saldhana at jboss.com
Date: 2010-04-06 17:12:00 -0400 (Tue, 06 Apr 2010)
New Revision: 103597
Modified:
projects/security/security-jboss-sx/branches/Branch_2_0/jbosssx/src/main/java/org/jboss/crypto/CryptoUtil.java
Log:
SECURITY-498: directly reference the JDK classes
Modified: projects/security/security-jboss-sx/branches/Branch_2_0/jbosssx/src/main/java/org/jboss/crypto/CryptoUtil.java
===================================================================
--- projects/security/security-jboss-sx/branches/Branch_2_0/jbosssx/src/main/java/org/jboss/crypto/CryptoUtil.java 2010-04-06 21:03:00 UTC (rev 103596)
+++ projects/security/security-jboss-sx/branches/Branch_2_0/jbosssx/src/main/java/org/jboss/crypto/CryptoUtil.java 2010-04-06 21:12:00 UTC (rev 103597)
@@ -35,6 +35,9 @@
import java.security.Security;
import java.util.Random;
+import javax.crypto.KeyGenerator;
+import javax.crypto.spec.SecretKeySpec;
+
import org.jboss.crypto.digest.DigestCallback;
import org.jboss.logging.Logger;
import org.jboss.security.Base64Encoder;
@@ -472,9 +475,8 @@
{
boolean hasUnlimitedCrypto = false;
try
- {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- Class<?> keyGenClass = loader.loadClass("javax.crypto.KeyGenerator");
+ {
+ Class<?> keyGenClass = KeyGenerator.class;
Class<?>[] sig = {String.class};
Object[] args = {"Blowfish"};
Method kgenInstance = keyGenClass.getDeclaredMethod("getInstance", sig);
@@ -504,9 +506,8 @@
Object[] args = {key, cipherAlgorithm};
Object secretKey = null;
try
- {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- Class<?> secretKeySpecClass = loader.loadClass("javax.crypto.spec.SecretKeySpec");
+ {
+ Class<?> secretKeySpecClass = SecretKeySpec.class;
Constructor<?> ctor = secretKeySpecClass.getDeclaredConstructor(signature);
secretKey = ctor.newInstance(args);
}
More information about the jboss-cvs-commits
mailing list