private static void populateSSE_C(Request<?> request, SSECustomerKey sseKey) {
        if (sseKey == null) return;

        addHeaderIfNotNull(request, Headers.SERVER_SIDE_ENCRYPTION_CUSTOMER_ALGORITHM,
                sseKey.getAlgorithm());
        addHeaderIfNotNull(request, Headers.SERVER_SIDE_ENCRYPTION_CUSTOMER_KEY,
                sseKey.getKey());
        addHeaderIfNotNull(request, Headers.SERVER_SIDE_ENCRYPTION_CUSTOMER_KEY_MD5,
                sseKey.getMd5());
        // Calculate the MD5 hash of the encryption key and fill it in the
        // header, if the user didn't specify it in the metadata
        if (sseKey.getKey() != null
                && sseKey.getMd5() == null) {
            String encryptionKey_b64 = sseKey.getKey();
            byte[] encryptionKey = Base64.decode(encryptionKey_b64);
            request.addHeader(Headers.SERVER_SIDE_ENCRYPTION_CUSTOMER_KEY_MD5,
                    Md5Utils.md5AsBase64(encryptionKey));
        }
    }
private static void populateSSE_C ( Request < ? > request , SSECustomerKey sseKey ) { if ( sseKey == null ) return ; addHeaderIfNotNull ( request , Headers . SERVER_SIDE_ENCRYPTION_CUSTOMER_ALGORITHM , sseKey . getAlgorithm ( ) ) ; addHeaderIfNotNull ( request , Headers . SERVER_SIDE_ENCRYPTION_CUSTOMER_KEY , sseKey . getKey ( ) ) ; addHeaderIfNotNull ( request , Headers . SERVER_SIDE_ENCRYPTION_CUSTOMER_KEY_MD5 , sseKey . getMd5 ( ) ) ; if ( sseKey . getKey ( ) != null && sseKey . getMd5 ( ) == null ) { String encryptionKey_b64 = sseKey . getKey ( ) ; byte [ ] encryptionKey = Base64 . decode ( encryptionKey_b64 ) ; request . addHeader ( Headers . SERVER_SIDE_ENCRYPTION_CUSTOMER_KEY_MD5 , Md5Utils . md5AsBase64 ( encryptionKey ) ) ; } }
<p>
Populates the specified request with the numerous attributes available in
<code>SSEWithCustomerKeyRequest</code>.
</p>

@param request
The request to populate with headers to represent all the
options expressed in the
<code>ServerSideEncryptionWithCustomerKeyRequest</code>
object.
@param sseKey
The request object for an S3 operation that allows server-side
encryption using customer-provided keys.