function hydrateEncryptionConfig(algorithm, configuredMasterKeyId, mandatory = null) {
    if (algorithm !== 'AES256' && algorithm !== 'aws:kms') {
        return {
            algorithm: null,
        };
    }

    const sseConfig = { algorithm, mandatory };

    if (algorithm === 'aws:kms' && configuredMasterKeyId) {
        // If key is not in a scality arn format include a scality arn prefix
        // of the currently selected KMS client.
        // To keep track of KMS type, protocol and provider used
        sseConfig.configuredMasterKeyId = isScalityKmsArn(configuredMasterKeyId)
            ? configuredMasterKeyId
            : `${kms.arnPrefix}${configuredMasterKeyId}`;
    }

    if (mandatory !== null) {
        sseConfig.mandatory = mandatory;
    }

    return sseConfig;
}
hydrateEncryptionConfig - Constructs a ServerSideEncryptionInfo object from arguments
ensuring no invalid or undefined keys are added

@param {string} algorithm - Algorithm to use for encryption. Either AES256 or aws:kms.
@param {string} configuredMasterKeyId - User configured master key id.
@param {boolean} [mandatory] - Whether a default encryption policy has been enabled.
@returns {ServerSideEncryptionInfo} - SSE configuration