Package org.apache.wicket.util.crypt
Class CipherUtils
- java.lang.Object
-
- org.apache.wicket.util.crypt.CipherUtils
-
public class CipherUtils extends Object
Utility class meant to help buildingCipher
.
-
-
Constructor Summary
Constructors Constructor Description CipherUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SecretKey
generateKey(String algorithm, int keyLength, SecureRandom secureRandom)
Generate a newSecretKey
based on the given algorithm and with the given length.static SecretKey
generatePBEKey(String password, String pbeAlgorithm, String keyAlgorithm, byte[] salt, int iterationCount, int keyLength)
-
-
-
Constructor Detail
-
CipherUtils
public CipherUtils()
-
-
Method Detail
-
generateKey
public static SecretKey generateKey(String algorithm, int keyLength, SecureRandom secureRandom)
Generate a newSecretKey
based on the given algorithm and with the given length.- Parameters:
algorithm
- the algorithm that will be used to build the key.keyLength
- the key length- Returns:
- a new
SecretKey
-
generatePBEKey
public static SecretKey generatePBEKey(String password, String pbeAlgorithm, String keyAlgorithm, byte[] salt, int iterationCount, int keyLength)
- Parameters:
password
- the password that will be used to build the key.pbeAlgorithm
- the password-based algorithm that will be used to build the key.keyAlgorithm
- the algorithm that will be used to build the key.salt
- salt for encryption.iterationCount
- iteration count.keyLength
- the key length.- Returns:
- a new
SecretKey
-
-