Top Description Fields Constructors Methods
com.ongres.scram.common.bouncycastle.pbkdf2

public abstract Class PBEParametersGenerator

extends Object
Class Inheritance
Known Direct Subclasses
com.ongres.scram.common.bouncycastle.pbkdf2.PKCS5S2ParametersGenerator

super class for all Password Based Encryption (PBE) parameter generator classes.

Field Summary

Modifier and TypeField and Description
protected int
protected byte[]
protected byte[]

Constructor Summary

AccessConstructor and Description
protected
PBEParametersGenerator()

base constructor.

Method Summary

Modifier and TypeMethod and Description
public abstract CipherParameters

Returns:

a parameters object representing a key.
generateDerivedParameters
(int
the length, in bits, of the key required.
keySize
)

generate derived parameters for a key of length keySize.

public int

Returns:

the iteration count.
getIterationCount
()

return the iteration count.

public byte[]

Returns:

the password byte array.
getPassword
()

return the password byte array.

public byte[]

Returns:

the salt byte array.
getSalt
()

return the salt byte array.

public void
init(byte[]
the password converted into bytes (see below).
password
,
byte[]
the salt to be mixed with the password.
salt
,
int
the number of iterations the "mixing" function is to be applied for.
iterationCount
)

initialise the PBE generator.

public static byte[]

Returns:

a byte array representing the password.
PKCS5PasswordToUTF8Bytes
(char[]
a character array representing the password.
password
)

converts a password to a byte array according to the scheme in PKCS5 (UTF-8, no padding)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

iterationCountback to summary
protected int iterationCount
passwordback to summary
protected byte[] password
saltback to summary
protected byte[] salt

Constructor Detail

PBEParametersGeneratorback to summary
protected PBEParametersGenerator()

base constructor.

Method Detail

generateDerivedParametersback to summary
public abstract CipherParameters generateDerivedParameters(int keySize)

generate derived parameters for a key of length keySize.

Parameters
keySize:int

the length, in bits, of the key required.

Returns:CipherParameters

a parameters object representing a key.

getIterationCountback to summary
public int getIterationCount()

return the iteration count.

Returns:int

the iteration count.

getPasswordback to summary
public byte[] getPassword()

return the password byte array.

Returns:byte[]

the password byte array.

getSaltback to summary
public byte[] getSalt()

return the salt byte array.

Returns:byte[]

the salt byte array.

initback to summary
public void init(byte[] password, byte[] salt, int iterationCount)

initialise the PBE generator.

Parameters
password:byte[]

the password converted into bytes (see below).

salt:byte[]

the salt to be mixed with the password.

iterationCount:int

the number of iterations the "mixing" function is to be applied for.

PKCS5PasswordToUTF8Bytesback to summary
public static byte[] PKCS5PasswordToUTF8Bytes(char[] password)

converts a password to a byte array according to the scheme in PKCS5 (UTF-8, no padding)

Parameters
password:char[]

a character array representing the password.

Returns:byte[]

a byte array representing the password.