org.mozilla.jss.pkcs11
Class PK11KeyGenerator
java.lang.Object
org.mozilla.jss.pkcs11.PK11KeyGenerator
- KeyGenerator
public final class PK11KeyGenerator
extends java.lang.Object
implements KeyGenerator
generate
public SymmetricKey generate()
throws IllegalStateException,
TokenException,
CharConversionException
Generates the key. This is the public interface, the actual
work is done by native methods.
generatePBE_IV
public byte[] generatePBE_IV()
throws TokenException,
CharConversionException
Generates an Initialization Vector using a PBE algorithm.
In order to call this method, the algorithm must be a PBE algorithm,
and the KeyGenerator must have been initialized with an instance
of PBEKeyGenParams
.
- The initialization vector derived from the password and salt
using the PBE algorithm.
initialize
public void initialize(AlgorithmParameterSpec parameters)
throws InvalidAlgorithmParameterException
initialize
public void initialize(int strength)
throws InvalidAlgorithmParameterException
strength
- Key size in bits. Must be evenly divisible by 8.
setCharToByteConverter
public void setCharToByteConverter(KeyGenerator.CharToByteConverter charToByte)
Sets the character to byte converter for passwords. The default
conversion is UTF8 with no null termination.