public CryptoModuleDispatcher(AWSKMSClient kms, S3Direct s3,
AWSCredentialsProvider credentialsProvider,
EncryptionMaterialsProvider encryptionMaterialsProvider,
CryptoConfiguration cryptoConfig) {
cryptoConfig = cryptoConfig.clone(); // make a clone
CryptoMode cryptoMode = cryptoConfig.getCryptoMode();
if (cryptoMode == null) {
cryptoMode = EncryptionOnly;
cryptoConfig.setCryptoMode(cryptoMode); // defaults to EO
}
cryptoConfig = cryptoConfig.readOnly(); // make read-only