Examples of SRPServerInterface


Examples of org.jboss.security.srp.SRPServerInterface

      Logger root = Logger.getRootLogger();
      root.setLevel(Level.TRACE);
      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");
      byte[] M1 = client.response(B);
      byte[] M2 = server.verify(username, M1);
      System.out.println("Sent M1 challenge, got M2 challenge");
      if (client.verify(M2) == false)
         throw new SecurityException("Failed to validate server reply");
      System.out.println("Validation successful");
      server.close(username);
   }
View Full Code Here

Examples of org.jboss.security.srp.SRPServerInterface

      }
   }

   private SRPServerInterface loadServerFromJndi(String jndiName)
   {
      SRPServerInterface server = null;
      try
      {
         InitialContext ctx = new InitialContext(jndiEnv);
         server = (SRPServerInterface) ctx.lookup(jndiName);
      }
View Full Code Here

Examples of org.jboss.security.srp.SRPServerInterface

      }
      return server;
   }
   private SRPServerInterface loadServer(String rmiUrl)
   {
      SRPServerInterface server = null;
      try
      {
         server = (SRPServerInterface) Naming.lookup(rmiUrl);
      }
      catch(Exception e)
View Full Code Here

Examples of org.jboss.security.srp.SRPServerInterface

      }
   }

   private SRPServerInterface loadServerFromJndi(String jndiName)
   {
      SRPServerInterface server = null;
      try
      {
         InitialContext ctx = new InitialContext(jndiEnv);
         server = (SRPServerInterface) ctx.lookup(jndiName);
      }
View Full Code Here

Examples of org.jboss.security.srp.SRPServerInterface

      }
      return server;
   }
   private SRPServerInterface loadServer(String rmiUrl)
   {
      SRPServerInterface server = null;
      try
      {
         server = (SRPServerInterface) Naming.lookup(rmiUrl);
      }
      catch(Exception e)
View Full Code Here

Examples of org.jboss.security.srp.SRPServerInterface

      Logger root = Logger.getRoot();
      root.setLevel(XLevel.TRACE);
      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");
      byte[] M1 = client.response(B);
      byte[] M2 = server.verify(username, M1);
      System.out.println("Sent M1 challenge, got M2 challenge");
      if (client.verify(M2) == false)
         throw new SecurityException("Failed to validate server reply");
      System.out.println("Validation successful");
      server.close(username);
   }
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.