java.lang.Object
org.apache.wicket.util.crypt.CipherUtils
Utility class meant to help building
Cipher
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
CipherUtils
public CipherUtils()
-
-
Method Details
-
generateKey
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
-