Class Overview
The key specification for a password based encryption key.
Password based encryption is described in PKCS #5.
Summary
Public Constructors |
|
PBEKeySpec(char[] password)
Creates a new PBEKeySpec with the specified password.
|
|
PBEKeySpec(char[] password, byte[] salt, int iterationCount, int keyLength)
Creates a new PBEKeySpec with the specified password, salt,
iteration count and the desired length of the derived key.
|
|
PBEKeySpec(char[] password, byte[] salt, int iterationCount)
Creates a new PBEKeySpec with the specified password, salt
and iteration count.
|
Public Methods |
final
void
|
clearPassword()
Clears the password by overwriting it.
|
final
int
|
getIterationCount()
Returns the iteration count of this key specification.
|
final
int
|
getKeyLength()
Returns the desired key length of the derived key.
|
final
char[]
|
getPassword()
Returns a copy of the password of this key specification.
|
final
byte[]
|
getSalt()
Returns a copy of the salt of this key specification.
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
final
Class<?>
|
getClass()
Returns the unique instance of Class that represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
final
void
|
wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
|
Public Constructors
public
PBEKeySpec
(char[] password)
Creates a new PBEKeySpec
with the specified password.
public
PBEKeySpec
(char[] password, byte[] salt, int iterationCount, int keyLength)
Creates a new PBEKeySpec
with the specified password, salt,
iteration count and the desired length of the derived key.
Parameters
password
| the password. |
salt
| the salt. |
iterationCount
| the iteration count. |
keyLength
| the desired key length of the derived key, |
public
PBEKeySpec
(char[] password, byte[] salt, int iterationCount)
Creates a new PBEKeySpec
with the specified password, salt
and iteration count.
Parameters
password
| the password. |
salt
| the salt. |
iterationCount
| the iteration count. |
Public Methods
public
final
void
clearPassword
()
Clears the password by overwriting it.
public
final
int
getIterationCount
()
Returns the iteration count of this key specification.
Returns
- the iteration count of this key specification.
public
final
int
getKeyLength
()
Returns the desired key length of the derived key.
Returns
- the desired key length of the derived key.
public
final
char[]
getPassword
()
Returns a copy of the password of this key specification.
Returns
- a copy of the password of this key specification.
public
final
byte[]
getSalt
()
Returns a copy of the salt of this key specification.
Returns
- a copy of the salt of this key specification or null if none is
specified.