/** * Gets the secret key as per WS-Trust spec. This method uses default setting * to generate the secret key. These default values are suitable for .NET * WSE. * * @return a secret key constructed from information contained in this * username token */ public byte[] getSecretKey() { return getSecretKey(WSConstants.WSE_DERIVED_KEY_LEN, WSConstants.LABEL_FOR_DERIVED_KEY); }
/** * Gets the secret key as per WS-Trust spec. This method uses default setting * to generate the secret key. These default values are suitable for .NET * WSE. * * @return a secret key constructed from information contained in this * username token */ public byte[] getSecretKey(int keylen) { return getSecretKey(keylen, WSConstants.LABEL_FOR_DERIVED_KEY); }
/** * Gets the secret key as per WS-Trust spec. This method uses default setting * to generate the secret key. These default values are suitable for .NET * WSE. * * @return a secret key constructed from information contained in this * username token */ public byte[] getSecretKey() { return getSecretKey(WSConstants.WSE_DERIVED_KEY_LEN, WSConstants.LABEL_FOR_DERIVED_KEY); }
/** * Gets the secret key as per WS-Trust spec. This method uses default setting * to generate the secret key. These default values are suitable for .NET * WSE. * * @return a secret key constructed from information contained in this * username token */ public byte[] getSecretKey(int keylen) { return getSecretKey(keylen, WSConstants.LABEL_FOR_DERIVED_KEY); }
/** * Get the derived secret key. * * After the <code>prepare()</code> method was called use this method * to compute a derived secret key. If "useDerivedKey" is set, then the returned secret * key is derived as per the UsernameToken 1.1 specification. Otherwise, the generation * of this secret key is according to the WS-Trust specifications. * * @return Return the derived secret key of this token or null if <code>prepare()</code> * was not called before. */ public byte[] getSecretKey() throws WSSecurityException { if (ut == null) { return null; } if (useDerivedKey) { if (passwordsAreEncoded) { return UsernameToken.generateDerivedKey(Base64.decode(password), saltValue, iteration); } else { return UsernameToken.generateDerivedKey(password, saltValue, iteration); } } return ut.getSecretKey(secretKeyLength); }
/** * Get the derived secret key. * * After the <code>prepare()</code> method was called use this method * to compute a derived secret key. If "useDerivedKey" is set, then the returned secret * key is derived as per the UsernameToken 1.1 specification. Otherwise, the generation * of this secret key is according to the WS-Trust specifications. * * @return Return the derived secret key of this token or null if <code>prepare()</code> * was not called before. */ public byte[] getSecretKey() throws WSSecurityException { if (ut == null) { return null; } if (useDerivedKey) { if (passwordsAreEncoded) { return UsernameToken.generateDerivedKey(Base64.decode(password), saltValue, iteration); } else { return UsernameToken.generateDerivedKey(password, saltValue, iteration); } } return ut.getSecretKey(secretKeyLength); }
} else { int keyLength = ((Integer)parameters.get(SECRET_KEY_LENGTH)).intValue(); secretKey = usernameToken.getSecretKey(keyLength);
} else { int keyLength = ((Integer)parameters.get(SECRET_KEY_LENGTH)).intValue(); secretKey = usernameToken.getSecretKey(keyLength);