|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--iaik.security.cipher.PBEKeyBMP
A secret key for PBE (Password Based Encryption).
PKCS#12 breaks with the recommendation of PKCS#5 suggesting passwords to consist of printable ASCII characters. PKCS #12 creates passwords from BMPStrings with a NULL terminator by encoding every character of the original BMPString in 2 bytes in big-endian format (most-significant byte first).
This class returns the password as a byte array of the default ASCII encoding. But
in contrast to PBEKey
here the password is created from a BMPstring with
a NULL terminator.
E.g.: User-password "Beavis" would lead to the following string of 14 bytes:
0x00 0x42 0x00 0x65 0x00 0x61 0x00 0x76 0x00 0x69 0x00 0x73 0x00 0x00
Fields inherited from interface java.security.Key |
serialVersionUID |
Constructor Summary | |
PBEKeyBMP(char[] password)
Creates a new PBEKeyBMP from a char array. |
|
PBEKeyBMP(PBEKeySpec keySpec)
Creates a new PBEKey from a PBEKeySpec. |
|
PBEKeyBMP(String password)
Creates a new PBEKeyBMP from a String. |
Method Summary | |
String |
getAlgorithm()
Returns the algorithm name. |
byte[] |
getEncoded()
Returns the password as byte array. |
static byte[] |
getEncoded(char[] password)
Converts the ASCII passwort to a 2 bytes big-endian format BMPString. |
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 PBEKeyBMP(String password)
password
- the password as a stringpublic PBEKeyBMP(char[] password)
password
- the password as a char arraypublic PBEKeyBMP(PBEKeySpec keySpec)
keySpec
- the password as KeySpecMethod Detail |
public final byte[] getEncoded()
getEncoded
in interface Key
public static final byte[] getEncoded(char[] password)
public char[] getKey()
public String getAlgorithm()
getAlgorithm
in interface Key
public String getFormat()
getFormat
in interface Key
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |