private void configureEncryptionParameters(final String secretKeyEncryption, final String contentEncryptionAlgorithmIdentifier) {
        var secretKeyToUse = secretKeyEncryption;
        if (StringUtils.isBlank(secretKeyToUse)) {
            LOGGER.warn("Secret key for encryption is not defined for [{}]; CAS will attempt to auto-generate the encryption key", getName());
            secretKeyToUse = EncodingUtils.generateJsonWebKey(this.encryptionKeySize);
            val prop = String.format("%s=%s", getEncryptionKeySetting(), secretKeyToUse);
            //CHECKSTYLE:OFF
            LOGGER.warn("Generated encryption key [{}] of size [{}] for [{}]. The generated key MUST be added to CAS settings:\n\n\t{}\n\n",
                secretKeyToUse, this.encryptionKeySize, getName(), prop);
            //CHECKSTYLE:ON
        } else {
            try {
                val results = JsonUtil.parseJson(secretKeyToUse);
                LOGGER.trace("Parsed encryption key as a JSON web key for [{}] as [{}]", getName(), results);
                setEncryptionKey(EncodingUtils.generateJsonWebKey(results));
            } catch (final Exception e) {
                LOGGER.trace("Unable to recognize encryption key [{}] as a JSON web key: [{}].", getEncryptionKeySetting(), e.getMessage());
                LOGGER.debug("Using pre-defined encryption key to use for [{}]", getEncryptionKeySetting());
            }
        }
        try {
            if (ResourceUtils.doesResourceExist(secretKeyToUse)) {
                configureEncryptionKeyFromPublicKeyResource(secretKeyToUse);
            }
        } catch (final Exception e) {
            LoggingUtils.error(LOGGER, e);
        } finally {
            if (this.encryptionKey == null) {
                LOGGER.trace("Creating encryption key instance based on provided secret key");
                setEncryptionKey(EncodingUtils.generateJsonWebKey(secretKeyToUse));
            }
            if (StringUtils.isBlank(contentEncryptionAlgorithmIdentifier)) {
                setContentEncryptionAlgorithmIdentifier(EncryptionJwtCryptoProperties.DEFAULT_CONTENT_ENCRYPTION_ALGORITHM);
            } else {
                setContentEncryptionAlgorithmIdentifier(contentEncryptionAlgorithmIdentifier);
            }
            LOGGER.trace("Initialized cipher encryption sequence via content encryption [{}] and algorithm [{}]",
                this.contentEncryptionAlgorithmIdentifier, this.encryptionAlgorithm);
        }
    }
The {@link BaseStringCipherExecutor} is the default
implementation of {@link CipherExecutor}. It provides
a facade API to encrypt, sign, and verify values.

@author Misagh Moayyed
@since 4.1
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/cipher/BaseStringCipherExecutor.java