Class PBEAlgorithm


  • public class PBEAlgorithm
    extends KeyGenAlgorithm
    Algorithms that can be used for generating symmetric keys from passwords.
    • Field Detail

      • PBE_PKCS5_PBKDF2

        public static final PBEAlgorithm PBE_PKCS5_PBKDF2
      • PBE_PKCS5_PBES2

        public static final PBEAlgorithm PBE_PKCS5_PBES2
      • PBE_PKCS5_PBMAC1

        public static final PBEAlgorithm PBE_PKCS5_PBMAC1
      • 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
    • Method Detail

      • 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.