public byte [ ] getDerivedSigningKey ( String secretAccessKey , String dateStamp , String region , String amazonApi ) throws SignatureException { try { byte [ ] kSecret = ( AWS_SIGNATURE_VERSION + secretAccessKey ) . getBytes ( ENCODING ) ; byte [ ] kDate = calculateHmacSHA256 ( dateStamp , kSecret ) ; byte [ ] kRegion = calculateHmacSHA256 ( region , kDate ) ; byte [ ] kService = calculateHmacSHA256 ( amazonApi , kRegion ) ; return calculateHmacSHA256 ( AWS_REQUEST_VERSION , kService ) ; } catch ( NoSuchAlgorithmException | UnsupportedEncodingException | InvalidKeyException e ) { throw new SignatureException ( DERIVED_SIGNING_ERROR + e . getMessage ( ) ) ; } }
Derives a signing key from the AWS secret access key .