Permalink
Browse files

providers are now used to create ciphers (https://issues.jboss.org/br…

  • Loading branch information...
1 parent 8cafecb commit f8ade06ff8ca2ed300df2751aa4282c9c6d34d38 Bela Ban committed Jan 26, 2011
Showing with 14 additions and 3 deletions.
  1. +14 −3 src/org/jgroups/protocols/ENCRYPT.java
@@ -343,8 +343,15 @@ 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);
@@ -390,7 +397,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())

0 comments on commit f8ade06

Please sign in to comment.