public class SymmetricKeySpecFactoryImplPbe extends Object implements SymmetricKeySpecFactory
SymmetricKeySpecFactory for PBE (PBEKeySpec). For sufficient security
strength you should use a salt of 20 bytes, a key length of 256 bits (never
use less than 128 bits) and a high number of iterations (e.g. 65536).| Modifier and Type | Field and Description |
|---|---|
private int |
iterationCount |
private int |
keyLength |
private byte[] |
salt |
| Constructor and Description |
|---|
SymmetricKeySpecFactoryImplPbe()
The constructor.
|
SymmetricKeySpecFactoryImplPbe(byte[] salt)
The constructor.
|
SymmetricKeySpecFactoryImplPbe(byte[] salt,
int iterationCount)
The constructor.
|
SymmetricKeySpecFactoryImplPbe(byte[] salt,
int iterationCount,
int keyLength)
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
KeySpec |
createKeySpec(String password) |
int |
getIterationCount() |
int |
getKeyLength() |
private byte[] salt
private int iterationCount
private int keyLength
public SymmetricKeySpecFactoryImplPbe()
public SymmetricKeySpecFactoryImplPbe(byte[] salt)
salt - the salt or null for no salting.public SymmetricKeySpecFactoryImplPbe(byte[] salt,
int iterationCount)
salt - the salt or null for no salting.iterationCount - the iteration count.public SymmetricKeySpecFactoryImplPbe(byte[] salt,
int iterationCount,
int keyLength)
salt - the salt or null for no salting.iterationCount - the iteration count.keyLength - the key length.public KeySpec createKeySpec(String password)
createKeySpec in interface SymmetricKeySpecFactorypassword - the secret password.KeySpec for the given password. May contain additional information like salt.public int getIterationCount()
iteration count or 0 for no iterations.public int getKeyLength()
key length in bits or 0 if unspecified (to use defaults).Copyright © 2001–2019 mmm-Team. All rights reserved.