org.mozilla.jss.crypto
Class PBEAlgorithm
java.lang.Object
|
+--org.mozilla.jss.crypto.Algorithm
|
+--org.mozilla.jss.crypto.KeyGenAlgorithm
|
+--org.mozilla.jss.crypto.PBEAlgorithm
- public class PBEAlgorithm
- extends KeyGenAlgorithm
Algorithms that can be used for generating symmetric keys from passwords.
Method Summary |
EncryptionAlgorithm |
getEncryptionAlg()
Returns the EncryptionAlgorithm that should be used with keys
generated with this PBEAlgorithm. |
int |
getSaltLength()
Returns the number of bytes of salt that should be supplied when
generating keys with this algorithm. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
PBE_MD2_DES_CBC
public static final PBEAlgorithm PBE_MD2_DES_CBC
PBE_MD5_DES_CBC
public static final PBEAlgorithm PBE_MD5_DES_CBC
PBE_SHA1_DES_CBC
public static final PBEAlgorithm PBE_SHA1_DES_CBC
PBE_SHA1_RC4_128
public static final PBEAlgorithm PBE_SHA1_RC4_128
PBE_SHA1_RC4_40
public static final PBEAlgorithm PBE_SHA1_RC4_40
PBE_SHA1_DES3_CBC
public static final PBEAlgorithm PBE_SHA1_DES3_CBC
PBE_SHA1_RC2_128_CBC
public static final PBEAlgorithm PBE_SHA1_RC2_128_CBC
PBE_SHA1_RC2_40_CBC
public static final PBEAlgorithm PBE_SHA1_RC2_40_CBC
getEncryptionAlg
public EncryptionAlgorithm getEncryptionAlg()
- Returns the EncryptionAlgorithm that should be used with keys
generated with this PBEAlgorithm. For example,
PBE_MD2_DES_CBC.getEncryptionAlg()
returns
EncryptionAlgorithm.DES_CBC
.
getSaltLength
public int getSaltLength()
- Returns the number of bytes of salt that should be supplied when
generating keys with this algorithm.
PKCS #5 algorithms require exactly 8 bytes of salt. PKCS #12
algorithms take
a variable length, but recommend that the salt length be at least
as long as the output of the hash function. For SHA-1, the output
length is 20 bytes.