|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--iaik.security.cipher.PBEKey
A secret key for PBE (Password Based Encryption).
Password based encryption as defined in PKCS#5 encrypts the given message with the DES algorithm in CBC mode using a secret key which is derived from a password with the MD2 or MD5 message digest algorithm. PKCS#5 recommends, that the password should consist of printable ASCII characters.
This class returns the password as a byte array of the default ASCII encoding.
E.g.: "Beavis" gives the following string of 6 bytes:
0x42 0x65 0x61 0x76 0x69 0x73
You can also use the "PKCS#5" SecretKeyFactory for converting a password to a PBEKeyBMP.
SecretKey,
SecretKey,
PBEKeyBMP,
PbeWithMD5AndDES_CBC, Serialized Form| Fields inherited from interface java.security.Key |
serialVersionUID |
| Constructor Summary | |
PBEKey(char[] password)
Creates a new PBEKey from a char array. |
|
PBEKey(PBEKeySpec keySpec)
Creates a new PBEKey from a PBEKeySpec. |
|
PBEKey(java.lang.String password)
Creates a new PBEKey from a String. |
|
| Method Summary | |
java.lang.String |
getAlgorithm()
Returns the algorithm name. |
byte[] |
getEncoded()
Returns the password as byte array. |
java.lang.String |
getFormat()
Returns the format name. |
char[] |
getKey()
Returns the password as char array. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public PBEKey(java.lang.String password)
password - the password as a Stringpublic PBEKey(PBEKeySpec keySpec)
keySpec - the password as KeySpecpublic PBEKey(char[] password)
password - the password as a char array| Method Detail |
public byte[] getEncoded()
public char[] getKey()
public java.lang.String getAlgorithm()
public java.lang.String getFormat()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||