This commit is contained in:
Looly
2021-10-19 13:27:16 +08:00
parent 3e36d7fd21
commit e258fc1eb9
2 changed files with 3 additions and 2 deletions

View File

@@ -180,7 +180,7 @@ public class KeyUtil {
*/
public static SecretKey generateDESKey(String algorithm, byte[] key) {
if (StrUtil.isBlank(algorithm) || false == algorithm.startsWith("DES")) {
throw new CryptoException("Algorithm [{}] is not a DES algorithm!");
throw new CryptoException("Algorithm [{}] is not a DES algorithm!", algorithm);
}
SecretKey secretKey;
@@ -212,7 +212,7 @@ public class KeyUtil {
*/
public static SecretKey generatePBEKey(String algorithm, char[] key) {
if (StrUtil.isBlank(algorithm) || false == algorithm.startsWith("PBE")) {
throw new CryptoException("Algorithm [{}] is not a PBE algorithm!");
throw new CryptoException("Algorithm [{}] is not a PBE algorithm!", algorithm);
}
if (null == key) {