Class JceDataKeyProvider.Builder
java.lang.Object
org.jwcarman.codec.crypto.JceDataKeyProvider.Builder
- Enclosing class:
JceDataKeyProvider
Builder for
JceDataKeyProvider.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds theJceDataKeyProvider.secureRandom(SecureRandom random) Sets the source of randomness used to generate data keys.
-
Method Details
-
secureRandom
Sets the source of randomness used to generate data keys.- Parameters:
random- theSecureRandomto use; defaults to a new instance- Returns:
- this builder
-
provider
Sets theProviderused to look up theAES/KW/NoPaddingCipherfor wrapping and unwrapping data keys, so a FIPS-validated or otherwise pinned provider can be selected per provider instance instead of being installed as the JVM's globally highest-priority provider.Resolved once at
build()time: if the provider cannot supply the transform,build()throwsIllegalStateExceptionimmediately rather than letting the misconfiguration surface later as aDecryptionExceptionon the first unwrap.- Parameters:
provider- theProviderto use; defaults to the JDK's default provider lookup- Returns:
- this builder
-
build
Builds theJceDataKeyProvider.- Returns:
- a new
JceDataKeyProvider - Throws:
IllegalStateException- if a provider was set and cannot supplyAES/KW/NoPadding
-