question: public static byte [ ] hmac_sha1 ( byte [ ] keyBytes , byte [ ] text ) throws NoSuchAlgorithmException , InvalidKeyException { Mac hmacSha1 ; try { hmacSha1 = Mac . getInstance ( "HmacSHA1" ) ; } catch ( final NoSuchAlgorithmException nsae ) { hmacSha1 = Mac . getInstance ( "HMAC-SHA-1" ) ; } final SecretKeySpec macKey = new SecretKeySpec ( keyBytes , "RAW" ) ; hmacSha1 . init ( macKey ) ; return hmacSha1 . doFinal ( text ) ; }
target:  This method uses the JCE to provide the HMAC-SHA-1 algorithm. HMAC computes a Hashed Message Authentication Code and in this case SHA1 is the hash algorithm used.