public static Mac createSha1Hmac(final byte[] keyBytes)
            throws SaslException {
        try {
            SecretKeySpec key = new SecretKeySpec(keyBytes, "HmacSHA1");
            Mac mac = Mac.getInstance("HmacSHA1");
            mac.init(key);
            return mac;
        } catch (NoSuchAlgorithmException | InvalidKeyException e) {
            throw new SaslException(e.getMessage(), e);
        }
    }
A utility class that provides methods that are useful for dealing with
Salted Challenge Response Authentication Mechanism (SCRAM).

@author Richard Midwinter
xmppserver/src/main/java/org/jivesoftware/openfire/auth/ScramUtils.java