class InternalRequestSignature {

    public static void addToRequest(SecretKey key, byte[] requestBody, String signatureAlgorithm, Request request) {
        Mac mac;
        try {
            mac = mac(signatureAlgorithm);
        }  catch (NoSuchAlgorithmException e) {
            throw new ConnectException(e);
        }
        byte[] requestSignature = sign(mac, key, requestBody);
        request.header(InternalRequestSignature.SIGNATURE_HEADER, Base64.getEncoder().encodeToString(requestSignature))
               .header(InternalRequestSignature.SIGNATURE_ALGORITHM_HEADER, signatureAlgorithm);
    }

    public  InternalRequestSignature(byte[] requestBody, Mac mac, byte[] requestSignature);

}