Package org.jboss.ws.extensions.security.auth.callback

Examples of org.jboss.ws.extensions.security.auth.callback.UsernameTokenCallback


      try
      {
         // convert password to byte data
         byte[] passBytes = password.getBytes("UTF-8");
         // prepare the username token digest callback
         UsernameTokenCallback callback = new UsernameTokenCallback();
         Map options = new HashMap();
         callback.init(options);
         // add the username token callback handler to provide the parameters
         CallbackHandler handler = new UsernameTokenCallbackHandler(nonce, created);
         handler.handle((Callback[])options.get("callbacks"));
         // calculate the hash and apply the encoding.
         MessageDigest md = MessageDigest.getInstance("SHA");
         callback.preDigest(md);
         md.update(passBytes);
         callback.postDigest(md);
         byte[] hash = md.digest();
         passwordHash =  Base64Encoder.encode(hash);
      }
      catch(Exception e)
      {
View Full Code Here


      try
      {
         // convert password to byte data
         byte[] passBytes = password.getBytes("UTF-8");
         // prepare the username token digest callback
         UsernameTokenCallback callback = new UsernameTokenCallback();
         Map options = new HashMap();
         callback.init(options);
         // add the username token callback handler to provide the parameters
         CallbackHandler handler = new UsernameTokenCallbackHandler(nonce, created);
         handler.handle((Callback[])options.get("callbacks"));
         // calculate the hash and apply the encoding.
         MessageDigest md = MessageDigest.getInstance("SHA");
         callback.preDigest(md);
         md.update(passBytes);
         callback.postDigest(md);
         byte[] hash = md.digest();
         passwordHash =  Base64Encoder.encode(hash);
      }
      catch(Exception e)
      {
View Full Code Here

      try
      {
         // convert password to byte data
         byte[] passBytes = password.getBytes("UTF-8");
         // prepare the username token digest callback
         UsernameTokenCallback callback = new UsernameTokenCallback();
         Map options = new HashMap();
         callback.init(options);
         // add the username token callback handler to provide the parameters
         CallbackHandler handler = new UsernameTokenCallbackHandler(nonce, created);
         handler.handle((Callback[])options.get("callbacks"));
         // calculate the hash and apply the encoding.
         MessageDigest md = MessageDigest.getInstance("SHA");
         callback.preDigest(md);
         md.update(passBytes);
         callback.postDigest(md);
         byte[] hash = md.digest();
         passwordHash =  Base64Encoder.encode(hash);
      }
      catch(Exception e)
      {
View Full Code Here

TOP

Related Classes of org.jboss.ws.extensions.security.auth.callback.UsernameTokenCallback

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.