Package de.rtner.security.auth.spi

Examples of de.rtner.security.auth.spi.MacBasedPRF.doFinal()


    PBKDF2Engine engine = new PBKDF2Engine(new PBKDF2Parameters("HMacSHA1", null, serverSalt, Integer.parseInt(iterationCount)));
    byte[] saltedPassword = engine.deriveKey(password, 20);

      // ClientKey       := HMAC(SaltedPassword, "Client Key")
    hmac.init(saltedPassword);
    byte[] clientKey = hmac.doFinal("Client Key".getBytes());

    // StoredKey       := H(ClientKey)
    byte[] storedKey = md.digest(clientKey);

      // AuthMessage     := client-first-message-bare + "," +
View Full Code Here


    String strAuthMessage = clientFirstMessageBare + "," + serverFirstMessage + "," + clientFinalMessage;

    // ClientSignature := HMAC(StoredKey, AuthMessage)
    hmac = new MacBasedPRF("HMacSha1");
    hmac.init(storedKey);
    byte[] clientSignature = hmac.doFinal(strAuthMessage.getBytes());

    // ClientProof     := ClientKey XOR ClientSignature
        for (int i = 0; i < 20; i++)
        {
          clientKey[i] ^= clientSignature[i];
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.