|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.vt.middleware.crypt.pbe.AbstractPKCSKeyGenerator
public abstract class AbstractPKCSKeyGenerator
Base class for all PKCS key generators that use a key derivation function that performs iterative hashing operations on a salted password.
For a key derivation function f, the following formula applies:
derivedKey = f(password, salt, iterations)
Classes derived from this class are NOT thread safe.
| Field Summary | |
|---|---|
static int |
DEFAULT_ITERATION_COUNT
Default number of iterations taken from examples in PKCS#5v2. |
protected int |
iterationCount
Key derifcation function iteration count. |
protected byte[] |
salt
Key derifcation function salt. |
| Constructor Summary | |
|---|---|
AbstractPKCSKeyGenerator()
|
|
| Method Summary | |
|---|---|
byte[] |
generate(char[] password,
int size)
Generates a symmetric key from a password for use in password-based encryption schemes. |
protected abstract org.bouncycastle.crypto.PBEParametersGenerator |
newParamGenerator()
Creates a new BC parameter generator instance. |
protected void |
setIterationCount(int count)
Gets the key derivation function iteration count. |
protected abstract byte[] |
toBytes(char[] password)
Converts password characters to bytes in implementation-dependent fashion. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_ITERATION_COUNT
protected byte[] salt
protected int iterationCount
| Constructor Detail |
|---|
public AbstractPKCSKeyGenerator()
| Method Detail |
|---|
public byte[] generate(char[] password,
int size)
generate in interface KeyGeneratorpassword - Password used as basis for generated key.size - Size of generated key in bits, unless otherwise noted.
protected void setIterationCount(int count)
count - Iteration count. MUST be positive integer.protected abstract org.bouncycastle.crypto.PBEParametersGenerator newParamGenerator()
protected abstract byte[] toBytes(char[] password)
password - Password to convert.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||