This commit is contained in:
Looly
2023-04-12 01:18:11 +08:00
parent bc601ca0ad
commit d2e5155ac5
205 changed files with 500 additions and 492 deletions

View File

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