Package com.tnsai.quality.security
Class EncryptionConfig.Builder
java.lang.Object
com.tnsai.quality.security.EncryptionConfig.Builder
- Enclosing class:
EncryptionConfig
Builder for creating EncryptionConfig with custom settings.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the EncryptionConfig.ivLengthBytes(int ivLengthBytes) Sets the IV length in bytes (default: 12).key(byte[] keyBytes) Sets the secret key from raw bytes.Sets the secret key from Base64-encoded string.Sets the secret key.tagLengthBits(int tagLengthBits) Sets the authentication tag length in bits (default: 128).
-
Method Details
-
key
Sets the secret key from Base64-encoded string.- Throws:
IllegalArgumentException- if the decoded key is not 16, 24, or 32 bytes
-
key
Sets the secret key from raw bytes.- Throws:
IllegalArgumentException- if the key is not 16, 24, or 32 bytes
-
key
Sets the secret key. -
ivLengthBytes
Sets the IV length in bytes (default: 12). -
tagLengthBits
Sets the authentication tag length in bits (default: 128). Valid values: 96, 104, 112, 120, 128 -
build
Builds the EncryptionConfig. If no key is provided, generates a new one.
-