public byte[] sign(String stringData, byte[] key,
            SigningAlgorithm algorithm) throws SdkClientException {
        try {
            byte[] data = stringData.getBytes(UTF8);
            return sign(data, key, algorithm);
        } catch (Exception e) {
            throw new SdkClientException(
                    "Unable to calculate a request signature: "
                            + e.getMessage(), e);
        }
    }
Computes an RFC 2104-compliant HMAC signature for an array of bytes and
returns the result as a Base64 encoded string.
aws-java-sdk-core/src/main/java/com/amazonaws/auth/AbstractAWSSigner.java