|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.crypto.provider.PKCS5KeySpec
public class PKCS5KeySpec
Specification for a "generalized" PBE key. While a PBEKey is derived from a password and is used in the PBEWithMD5andDES cipher, a PKCS5Key is derived from a password and can be used in any PBES1 encryption schemes (for example, PBEWithMD5AndDES, PBEWithMD2AndRC2, PBEWithSHAAndTripleDES, etc).
Note that this class stores passwords as char arrays instead of
String
objects (which would seem more logical), because the
String class is immutable and there is no way to overwrite its
internal value when the password stored in it is no longer needed. Hence,
this class requests the password as a char array, so it can be overwritten
when done.
Constructor Summary | |
---|---|
PKCS5KeySpec(char[] password,
String alg)
Constructor that takes a password and an algorithm. |
Method Summary | |
---|---|
protected void |
finalize()
Ensures that the password characters of this spec are set to blanks when there are no more references to it. |
String |
getAlgorithm()
Returns the algorithm. |
char[] |
getPassword()
Returns the password. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PKCS5KeySpec(char[] password, String alg)
Note that the given password is cloned before it is stored in
the new PKCS5KeySpec
object.
password
- the password.alg
- the algorithm.Method Detail |
---|
public final char[] getPassword()
Note that this method returns a reference to the password. It is the caller's responsibility to zero out the password information after it is no longer needed.
public final String getAlgorithm()
protected void finalize()
finalize
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |