PBEKeySpecCommon

constructor(password: CharArray?)

Constructor that takes a password. An empty char[] is used if null is specified.

Note: password is cloned before it is stored in the new PBEKeySpec object.

Parameters

password

the password.


constructor(password: CharArray?, salt: ByteArray?, iterationCount: Int, keyLength: Int)

Constructor that takes a password, salt, iteration count, and to-be-derived key length for generating PBEKey of variable-key-size PBE ciphers. An empty char[] is used if null is specified for password.

Note: the password and salt are cloned before they are stored in the new PBEKeySpec object.

Parameters

password

the password.

salt

the salt.

iterationCount

the iteration count.

keyLength

the to-be-derived key length.

Throws

if salt is null.

if salt is empty, i.e. 0-length, iterationCount or keyLength is not positive.


constructor(password: CharArray?, salt: ByteArray?, iterationCount: Int)

Constructor that takes a password, salt, iteration count for generating PBEKey of fixed-key-size PBE ciphers. An empty char[] is used if null is specified for password.

Note: the password and salt are cloned before they are stored in the new PBEKeySpec object.

Parameters

password

the password.

salt

the salt.

iterationCount

the iteration count.

Throws

if salt is null.

if salt is empty, i.e. 0-length, or iterationCount is not positive.