public abstract class PBEParametersGenerator extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
iterationCount |
protected byte[] |
password |
protected byte[] |
salt |
Modifier | Constructor and Description |
---|---|
protected |
PBEParametersGenerator()
base constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract CipherParameters |
generateDerivedParameters(int keySize)
generate derived parameters for a key of length keySize.
|
int |
getIterationCount()
return the iteration count.
|
byte[] |
getPassword()
return the password byte array.
|
byte[] |
getSalt()
return the salt byte array.
|
void |
init(byte[] password,
byte[] salt,
int iterationCount)
initialise the PBE generator.
|
static byte[] |
PKCS5PasswordToUTF8Bytes(char[] password)
converts a password to a byte array according to the scheme in
PKCS5 (UTF-8, no padding)
|
protected byte[] password
protected byte[] salt
protected int iterationCount
public void init(byte[] password, byte[] salt, int iterationCount)
password
- the password converted into bytes (see below).salt
- the salt to be mixed with the password.iterationCount
- the number of iterations the "mixing" function
is to be applied for.public byte[] getPassword()
public byte[] getSalt()
public int getIterationCount()
public abstract CipherParameters generateDerivedParameters(int keySize)
keySize
- the length, in bits, of the key required.public static byte[] PKCS5PasswordToUTF8Bytes(char[] password)
password
- a character array representing the password.Copyright © 2019–2023. All rights reserved.