|
@@ -4,7 +4,6 @@ import javax.crypto.Cipher;
|
|
|
|
|
|
import com.chelvc.framework.common.util.AESUtils;
|
|
|
import com.chelvc.framework.common.util.AssertUtils;
|
|
|
-import com.chelvc.framework.common.util.ObjectUtils;
|
|
|
import lombok.NonNull;
|
|
|
|
|
|
/**
|
|
@@ -19,15 +18,15 @@ public class AESCipherFactory implements CipherFactory {
|
|
|
private final String secret;
|
|
|
private final String iv;
|
|
|
|
|
|
- public AESCipherFactory(String secret) {
|
|
|
- this(secret, ObjectUtils.ifNull(secret, AESUtils::secret2iv));
|
|
|
+ public AESCipherFactory(@NonNull String secret) {
|
|
|
+ this(secret, AESUtils.secret2iv(secret));
|
|
|
}
|
|
|
|
|
|
- public AESCipherFactory(String secret, String iv) {
|
|
|
+ public AESCipherFactory(@NonNull String secret, @NonNull String iv) {
|
|
|
this(AESUtils.CBC_PKCS5PADDING, secret, iv);
|
|
|
}
|
|
|
|
|
|
- public AESCipherFactory(@NonNull String name, String secret, String iv) {
|
|
|
+ public AESCipherFactory(@NonNull String name, @NonNull String secret, @NonNull String iv) {
|
|
|
this.key = name + secret;
|
|
|
this.name = name;
|
|
|
this.secret = secret;
|