Package gnu.javax.crypto.sasl.srp

Examples of gnu.javax.crypto.sasl.srp.PasswordFile


        else if (!f.canRead() || !f.canWrite())
          {
            throw new RuntimeException("File " + pFile
                                       + " exists but is not accessible");
          }
        tpasswd = new PasswordFile(pFile, p2File, cFile);
        if (!tpasswd.contains(user))
          {
            byte[] testSalt = new byte[10];
            prng.nextBytes(testSalt);
            tpasswd.add(user, password, testSalt, "1");
View Full Code Here


      throw new RuntimeException("File object " + pFile
                                 + " exists but is not a file");
    else if (!f.canRead() || !f.canWrite())
      throw new RuntimeException("File " + pFile
                                 + " exists but is not accessible");
    final PasswordFile tpasswd = new PasswordFile(pFile, p2File, cFile);
    if (!tpasswd.contains(user))
      {
        final byte[] testSalt = new byte[10];
        prng.nextBytes(testSalt);
        tpasswd.add(user, password, testSalt, SRPRegistry.N_2048_BITS);
      }
    else
      tpasswd.changePasswd(user, password);

    final String[] entry = tpasswd.lookup(user, md);
    final BigInteger v = new BigInteger(1, Util.fromBase64(entry[0]));
    final byte[] salt = Util.fromBase64(entry[1]);

    final String[] mpi = tpasswd.lookupConfig(entry[2]);
    final BigInteger N = new BigInteger(1, Util.fromBase64(mpi[0]));
    final BigInteger g = new BigInteger(1, Util.fromBase64(mpi[1]));

    final IKeyPairGenerator kpg = new SRPKeyPairGenerator();
    final HashMap attributes = new HashMap();
View Full Code Here

TOP

Related Classes of gnu.javax.crypto.sasl.srp.PasswordFile

Copyright © 2018 www.massapicom. 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.