private String getEncodedApiKey(ElasticConnectionConfig config) {
        final String apiKeyId = config.getApiKeyId();
        final String apiKeySecret = config.getApiKeySecret();

        if (apiKeyId == null || apiKeyId.isEmpty() || apiKeySecret == null || apiKeySecret.isEmpty()) {
            return null;
        }

        final String combinedSecret = apiKeyId + ":" + apiKeySecret;
        return Base64.getEncoder().encodeToString(combinedSecret.getBytes(StandardCharsets.UTF_8));
    }
Encode the API key ID and secret in base64 for use in a HTTP request.
@return Base-64 encoded string. If no API key or secret are defined, returns `null`.
stroom-search/stroom-search-elastic/src/main/java/stroom/search/elastic/ElasticClientFactory.java