Package com.nimbusds.srp6.cli

Examples of com.nimbusds.srp6.cli.SRP6Client$User


      // Get the UserService.
      UserServiceInterface userService = user.getService(DfpService.V201308.USER_SERVICE);

      // Get the current user.
      User usr = userService.getCurrentUser();

      System.out.println("User with ID \"" + usr.getId()
          + "\", email \"" + usr.getEmail()
          + "\", and role \"" + usr.getRoleName() + "\" is the current user.");
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here


      // Create an array to store local user objects.
      User[] users = new User[emailAndNames.size()];

      for (int i = 0; i < users.length; i++) {
        // Create the new user structure.
        User newUser = new User();
        newUser.setEmail(emailAndNames.get(i)[0]);
        newUser.setName(emailAndNames.get(i)[1]);
        newUser.setRoleId(roleId);
        newUser.setPreferredLocale("en_US");

        users[i] = newUser;
      }

      // Create the users.
      users = userService.createUsers(users);

      if (users != null) {
        for (User newUser : users) {
          System.out.println("A user with ID \"" + newUser.getId()
              + "\", email \"" + newUser.getEmail()
              + "\", and role \"" + newUser.getRoleName() + "\" was created.");
        }
      } else {
        System.out.println("No users created.");
      }
    } catch (Exception e) {
View Full Code Here

      // Set the ID of the user to get.
      Long userId = Long.parseLong("INSERT_USER_ID_HERE");

      // Get the user.
      User usr = userService.getUser(userId);

      if (usr != null) {
        System.out.println("User with ID \"" + usr.getId()
            + "\" email \"" + usr.getEmail()
            + "\", and role \"" + usr.getRoleName() + "\" was found.");
      } else {
        System.out.println("No user found for this ID.");
      }
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

      // Get the UserService.
      UserServiceInterface userService = user.getService(DfpService.V201311.USER_SERVICE);

      // Get the current user.
      User usr = userService.getCurrentUser();

      System.out.println("User with ID \"" + usr.getId()
          + "\", email \"" + usr.getEmail()
          + "\", and role \"" + usr.getRoleName() + "\" is the current user.");
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

   
    System.out.print("\tEnter public server value 'B' (hex): ");
    BigInteger B = readBigInteger();
    System.out.println();
   
    SRP6ClientCredentials cred;
   
    try {
      cred = client.step2(config, s, B);
     
    } catch (SRP6Exception e) {
View Full Code Here

 
    // Step 1
 
    System.out.println("Client session step 1");
   
    SRP6ClientSession client = new SRP6ClientSession();
   
    User user = getUser("\t");
    client.step1(user.I, user.P);
 
    System.out.println();
   
   
    // Step 2
   
    System.out.println("Client session step 2");
   
    SRP6CryptoParams config = getConfig("\t");
   
    System.out.print("\tEnter salt 's' (hex): ");
    BigInteger s = readBigInteger();
    System.out.println();
   
    System.out.print("\tEnter public server value 'B' (hex): ");
    BigInteger B = readBigInteger();
    System.out.println();
   
    SRP6ClientCredentials cred;
   
    try {
      cred = client.step2(config, s, B);
     
    } catch (SRP6Exception e) {
     
      System.out.println(e.getMessage());
      return;
    }
   
    System.out.println("\tComputed public value 'A' (hex): " + BigIntegerUtils.toHex(cred.A));
    System.out.println("\tComputed evidence message 'M1' (hex): " + BigIntegerUtils.toHex(cred.M1));
    System.out.println();
   
   
    // Step 3
   
    System.out.println("Client session step 3");
   
    System.out.print("\tEnter server evidence message 'M2' (hex): ");
   
    BigInteger M2 = readBigInteger();
   
    try {
      client.step3(M2);
     
    } catch (SRP6Exception e) {
   
      System.out.println(e.getMessage());
      return;
View Full Code Here

   *            The large safe prime in radix10
   * @param g
   *            The safe prime generator in radix10
   */
  public SRP6JavascriptServerSessionSHA256(String N, String g) {
    super(new SRP6CryptoParams(fromDecimal(N), fromDecimal(g), SHA_256));
  }
View Full Code Here

   *            The large safe prime in radix10
   * @param g
   *            The safe prime generator in radix10
   */
  public SRP6JavascriptServerSessionSHA1(String N, String g) {
    super(new SRP6CryptoParams(fromDecimal(N), fromDecimal(g), SHA_1));
  }
View Full Code Here

*/
public class JavaVerifierGenerator {
  private final SRP6CryptoParams config;

  public JavaVerifierGenerator(String N, String g){
    config = new SRP6CryptoParams(SRP6JavascriptServerSession.fromDecimal(N), SRP6JavascriptServerSession.fromDecimal(g),
        SRP6JavascriptServerSessionSHA1.SHA_1);
  }
View Full Code Here

   */
  private void generatePasswordVerifier()
    throws IOException {
   
    System.out.println("Initialize verifier generator");
    SRP6CryptoParams config = getConfig("\t");
   
    SRP6VerifierGenerator vGen = new SRP6VerifierGenerator(config);
   
    User user = getUser("");
    System.out.println();
View Full Code Here

TOP

Related Classes of com.nimbusds.srp6.cli.SRP6Client$User

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.