Package org.jboss.security.srp

Examples of org.jboss.security.srp.SRPParameters


         return false;
      Set principals = subject.getPrincipals();
      principals.add(userPrincipal);
      subject.getPublicCredentials().add(clientChallenge);
      byte[] sessionKey = session.getSessionKey();
      SRPParameters params = session.getParameters();
      Set privateCredentials = subject.getPrivateCredentials();
      privateCredentials.add(params);
      if( params.cipherAlgorithm != null )
      {
         SecretKeySpec secretKey = new SecretKeySpec(sessionKey, params.cipherAlgorithm);
View Full Code Here


         {   // Remove userPrincipal
            Set s = subject.getPrincipals(userPrincipal.getClass());
            s.remove(userPrincipal);
            subject.getPublicCredentials().remove(clientChallenge);
            byte[] sessionKey = session.getSessionKey();
            SRPParameters params = session.getParameters();
            Set privateCredentials = subject.getPrivateCredentials();
            if( params.cipherAlgorithm != null )
            {
               SecretKeySpec secretKey = new SecretKeySpec(sessionKey, params.cipherAlgorithm);
               privateCredentials.remove(secretKey);
View Full Code Here

      root.addAppender(new ConsoleAppender(new PatternLayout("%x%m%n")));

      InitialContext ctx = new InitialContext();
      SRPServerInterface server = (SRPServerInterface) ctx.lookup(serviceName);
      System.out.println("Found SRPServerInterface, "+server);
      SRPParameters params = server.getSRPParameters(username);
      System.out.println("Found params for username: " + username);
      SRPClientSession client = new SRPClientSession(username, password, params);
      byte[] A = client.exponential();
      byte[] B = server.init(username, A);
      System.out.println("Sent A public key, got B public key");
View Full Code Here

       NDC.remove();
   }

    public void testProtocol() throws Exception
    {
        SRPParameters params = server.getSRPParameters(username);
        NDC.push("C,");
        SRPClientSession client = new SRPClientSession(username, password, params);
        byte[] A = client.exponential();
        NDC.pop();
        NDC.push("S,");
View Full Code Here

      NDC.pop();
      NDC.remove();
   }
   void login(String username, char[] password) throws Exception
   {
      SRPParameters params = server.getSRPParameters(username);
      NDC.push("C,");
      client = new SRPClientSession(username, password, params);
      byte[] A = client.exponential();
      NDC.pop();
      NDC.push("S,");
View Full Code Here

   SimpleSRPServer(char[] password, String salt)
   {
      byte[] N = SRPConf.getDefaultParams().Nbytes();
      byte[] g = SRPConf.getDefaultParams().gbytes();
      byte[] s = Util.fromb64(salt);
      params = new SRPParameters(N, g, s);
      this.password = password;
   }
View Full Code Here

      NDC.remove();
   }
  
   public void testProtocol() throws Exception
   {
      SRPParameters params = server.getSRPParameters(username);
      NDC.push("C,");
      SRPClientSession client = new SRPClientSession(username, password, params);
      byte[] A = client.exponential();
      NDC.pop();
      NDC.push("S,");
View Full Code Here

         log.trace("H(N): "+Util.tob64(hn));
         byte[] hg = Util.newDigest().digest(params.g);
         log.trace("H(g): "+Util.tob64(hg));
         byte[] sb = Util.fromb64(salt);
         this.password = password;
         params = new SRPParameters(Nb, gb, sb);
      }
View Full Code Here

      root.addAppender(new ConsoleAppender(new PatternLayout("%x%m%n")));

      InitialContext ctx = new InitialContext();
      SRPServerInterface server = (SRPServerInterface) ctx.lookup(serviceName);
      System.out.println("Found SRPServerInterface, "+server);
      SRPParameters params = server.getSRPParameters(username);
      System.out.println("Found params for username: " + username);
      SRPClientSession client = new SRPClientSession(username, password, params);
      byte[] A = client.exponential();
      byte[] B = server.init(username, A);
      System.out.println("Sent A public key, got B public key");
View Full Code Here

       NDC.remove();
   }

    public void testProtocol() throws Exception
    {
        SRPParameters params = server.getSRPParameters(username);
        NDC.push("C,");
        SRPClientSession client = new SRPClientSession(username, password, params);
        byte[] A = client.exponential();
        NDC.pop();
        NDC.push("S,");
View Full Code Here

TOP

Related Classes of org.jboss.security.srp.SRPParameters

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.