Class BasicPasswordSpecEncoding
- java.lang.Object
 - 
- org.wildfly.security.password.spec.BasicPasswordSpecEncoding
 
 
- 
public final class BasicPasswordSpecEncoding extends Object
Provide methods for encoding and decoding ofPasswordSpec.- Author:
 - David M. Lloyd, Pedro Igor
 
 
- 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PasswordSpecdecode(byte[] encoded)Decode the given byte array and create aPasswordSpecfrom it.static byte[]encode(Password password)Encode the givenPasswordto a byte array.static byte[]encode(Password password, Supplier<Provider[]> providers)Encode the givenPasswordto a byte array.static byte[]encode(PasswordSpec passwordSpec)Encode the givenPasswordSpecto a byte array. 
 - 
 
- 
- 
Method Detail
- 
encode
public static byte[] encode(PasswordSpec passwordSpec) throws NoSuchAlgorithmException, InvalidKeySpecException
Encode the givenPasswordSpecto a byte array.- Parameters:
 passwordSpec- the password spec to encode- Returns:
 - a byte array representing the encoded password or null if no encoder was capable to encode the given password
 - Throws:
 NoSuchAlgorithmExceptionInvalidKeySpecException
 
- 
encode
public static byte[] encode(Password password) throws NoSuchAlgorithmException, InvalidKeySpecException
Encode the givenPasswordto a byte array.- Parameters:
 password- the password to encode- Returns:
 - a byte array representing the encoded password or null if no encoder was capable to encode the given password
 - Throws:
 NoSuchAlgorithmExceptionInvalidKeySpecException
 
- 
encode
public static byte[] encode(Password password, Supplier<Provider[]> providers) throws NoSuchAlgorithmException, InvalidKeySpecException
Encode the givenPasswordto a byte array.- Parameters:
 password- the password to encodeproviders- providers to use with the underlyingPasswordFactory- Returns:
 - a byte array representing the encoded password or null if no encoder was capable to encode the given password
 - Throws:
 NoSuchAlgorithmExceptionInvalidKeySpecException
 
- 
decode
public static PasswordSpec decode(byte[] encoded)
Decode the given byte array and create aPasswordSpecfrom it.- Parameters:
 encoded- the byte array representing the encoded password- Returns:
 - a 
PasswordSpecinstance created from the encoded password or null if no decoder was capable to decode the given format. 
 
 - 
 
 -