Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ciphers are now created using providers (https://issues.jboss.org/bro…

  • Loading branch information...
commit 6ecec086b8da9e2c467ad56037045d0edddcd5a5 1 parent cbef126
@belaban authored
Showing with 16 additions and 3 deletions.
  1. +16 −3 src/org/jgroups/protocols/ENCRYPT.java
View
19 src/org/jgroups/protocols/ENCRYPT.java
@@ -460,8 +460,17 @@ private void initSymCiphers(String algorithm, SecretKey secret) throws Exception
if (log.isInfoEnabled())
log.info(" Initializing symmetric ciphers");
- symEncodingCipher = Cipher.getInstance(algorithm);
- symDecodingCipher = Cipher.getInstance(algorithm);
+ if (symProvider != null && symProvider.trim().length() > 0) {
+ symEncodingCipher = Cipher.getInstance(algorithm, symProvider);
+ symDecodingCipher = Cipher.getInstance(algorithm, symProvider);
+ }
+ else {
+ symEncodingCipher = Cipher.getInstance(algorithm);
+ symDecodingCipher = Cipher.getInstance(algorithm);
+ }
+
+
+
symEncodingCipher.init(Cipher.ENCRYPT_MODE, secret);
symDecodingCipher.init(Cipher.DECRYPT_MODE, secret);
@@ -508,7 +517,11 @@ public void initKeyPair() throws Exception
// set up the Cipher to decrypt secret key responses encrypted with our key
- asymCipher = Cipher.getInstance(asymAlgorithm);
+ if (asymProvider != null && asymProvider.trim().length() > 0)
+ asymCipher = Cipher.getInstance(asymAlgorithm, asymProvider);
+ else
+ asymCipher = Cipher.getInstance(asymAlgorithm);
+
asymCipher.init(Cipher.DECRYPT_MODE,Kpair.getPrivate());
if (log.isInfoEnabled())
Please sign in to comment.
Something went wrong with that request. Please try again.