public final class BasicPasswordSpecEncoding extends Object
PasswordSpec
.Modifier and Type | Method and Description |
---|---|
static PasswordSpec |
decode(byte[] encoded)
Decode the given byte array and create a
PasswordSpec from it. |
static byte[] |
encode(Password password)
Encode the given
Password to a byte array. |
static byte[] |
encode(PasswordSpec passwordSpec)
Encode the given
PasswordSpec to a byte array. |
static byte[] |
encode(Password password,
Supplier<Provider[]> providers)
Encode the given
Password to a byte array. |
public static byte[] encode(PasswordSpec passwordSpec) throws NoSuchAlgorithmException, InvalidKeySpecException
PasswordSpec
to a byte array.passwordSpec
- the password spec to encodeNoSuchAlgorithmException
InvalidKeySpecException
public static byte[] encode(Password password) throws NoSuchAlgorithmException, InvalidKeySpecException
Password
to a byte array.password
- the password to encodeNoSuchAlgorithmException
InvalidKeySpecException
public static byte[] encode(Password password, Supplier<Provider[]> providers) throws NoSuchAlgorithmException, InvalidKeySpecException
Password
to a byte array.password
- the password to encodeproviders
- providers to use with the underlying PasswordFactory
NoSuchAlgorithmException
InvalidKeySpecException
public static PasswordSpec decode(byte[] encoded)
PasswordSpec
from it.encoded
- the byte array representing the encoded passwordPasswordSpec
instance created from the encoded password or null if no decoder was capable to decode the given format.Copyright © 2020 JBoss by Red Hat. All rights reserved.