org.apache.wss4j.common.util
Class UsernameTokenUtil

java.lang.Object
  extended by org.apache.wss4j.common.util.UsernameTokenUtil

public final class UsernameTokenUtil
extends Object


Field Summary
static int DEFAULT_ITERATION
           
 
Method Summary
static byte[] generateDerivedKey(byte[] password, byte[] salt, int iteration)
          This static method generates a derived key as defined in WSS Username Token Profile.
static byte[] generateDerivedKey(String password, byte[] salt, int iteration)
          This static method generates a derived key as defined in WSS Username Token Profile.
static byte[] generateSalt(boolean useForMac)
          This static method generates a 128 bit salt value as defined in WSS Username Token Profile.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ITERATION

public static final int DEFAULT_ITERATION
See Also:
Constant Field Values
Method Detail

generateDerivedKey

public static byte[] generateDerivedKey(byte[] password,
                                        byte[] salt,
                                        int iteration)
                                 throws WSSecurityException
This static method generates a derived key as defined in WSS Username Token Profile.

Parameters:
password - The password to include in the key generation
salt - The Salt value
iteration - The Iteration value. If zero (0) is given the method uses the default value
Returns:
Returns the derived key a byte array
Throws:
WSSecurityException

generateDerivedKey

public static byte[] generateDerivedKey(String password,
                                        byte[] salt,
                                        int iteration)
                                 throws WSSecurityException
This static method generates a derived key as defined in WSS Username Token Profile.

Parameters:
password - The password to include in the key generation
salt - The Salt value
iteration - The Iteration value. If zero (0) is given the method uses the default value
Returns:
Returns the derived key a byte array
Throws:
WSSecurityException

generateSalt

public static byte[] generateSalt(boolean useForMac)
This static method generates a 128 bit salt value as defined in WSS Username Token Profile.

Parameters:
useForMac - If true define the Salt for use in a MAC
Returns:
Returns the 128 bit salt value as byte array


Copyright © 2004–2015 The Apache Software Foundation. All rights reserved.