public String getAuthenticationStr() {
        long expires = ((new Date()).getTime()) / 1000 + expiresInterval;

        String stringToSign = accessID + "\n" + expires;

        SecretKeySpec signingKey = new SecretKeySpec(secretKey.getBytes(), HMAC_SHA1_ALGORITHM);

        // get an hmac_sha1 Mac instance and initialize with the signing key
        Mac mac = null;
        try {
            mac = Mac.getInstance(HMAC_SHA1_ALGORITHM);
            mac.init(signingKey);
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
            return "";
        } catch (InvalidKeyException e) {
            e.printStackTrace();
            return "";
        }

        // compute the hmac on input data bytes
        byte[] rawHmac = mac.doFinal(stringToSign.getBytes());

        // base64-encode the hmac
        @SuppressWarnings("deprecation")
        String urlSafeSignature = URLEncoder.encode(encodeBase64(rawHmac));

        String authenticationStr = "AccessID=" + accessID + "&Expires=" + expires + "&Signature="
                + urlSafeSignature;

        return authenticationStr;
    }
This method calculates the authentication String based on the user's
credentials.

Set the user credentials before calling this method

@return the authentication string

@see #setAccessID(String)
@see #setSecretKey(String)
ache/src/main/java/achecrawler/link/backlink/MozAuthenticator.java