in src/main/java/software/aws/mcs/auth/SigV4AuthProvider.java [263:286]
private String generateSignature(byte[] nonce, Instant requestTimestamp, AwsCredentials credentials) throws UnsupportedEncodingException {
String credentialScopeDate = Aws4SignerUtils.formatDateStamp(requestTimestamp.toEpochMilli());
String signingScope = String.format("%s/%s/%s/aws4_request", credentialScopeDate, signingRegion, CANONICAL_SERVICE);
String nonceHash = sha256Digest(nonce);
String canonicalRequest = canonicalizeRequest(credentials.accessKeyId(), signingScope, requestTimestamp, nonceHash);
String stringToSign = String.format("%s\n%s\n%s\n%s",
SignerConstant.AWS4_SIGNING_ALGORITHM,
timestampFormatter.format(requestTimestamp),
signingScope,
sha256Digest(canonicalRequest));
byte[] signingKey = getSignatureKey(credentials.secretAccessKey(),
credentialScopeDate,
signingRegion,
CANONICAL_SERVICE);
byte[] signature = hmacSHA256(stringToSign, signingKey);
return Hex.encodeHexString(signature, true);
}