Class PBEAlgorithm


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

    • encAlg

      private EncryptionAlgorithm encAlg
    • saltLength

      private int saltLength
    • PKCS5

      private static final OBJECT_IDENTIFIER PKCS5
    • PKCS12_PBE

      private static final OBJECT_IDENTIFIER PKCS12_PBE
    • 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

      @Deprecated(since="5.0.1", forRemoval=true) public static final PBEAlgorithm PBE_SHA1_DES_CBC
      Deprecated, for removal: This API element is subject to removal in a future version.
    • PBE_SHA1_RC4_128

      @Deprecated(since="5.0.1", forRemoval=true) public static final PBEAlgorithm PBE_SHA1_RC4_128
      Deprecated, for removal: This API element is subject to removal in a future version.
    • PBE_SHA1_RC4_40

      @Deprecated(since="5.0.1", forRemoval=true) public static final PBEAlgorithm PBE_SHA1_RC4_40
      Deprecated, for removal: This API element is subject to removal in a future version.
    • PBE_SHA1_DES3_CBC

      @Deprecated(since="5.0.1", forRemoval=true) public static final PBEAlgorithm PBE_SHA1_DES3_CBC
      Deprecated, for removal: This API element is subject to removal in a future version.
    • PBE_SHA1_RC2_128_CBC

      @Deprecated(since="5.0.1", forRemoval=true) public static final PBEAlgorithm PBE_SHA1_RC2_128_CBC
      Deprecated, for removal: This API element is subject to removal in a future version.
    • PBE_SHA1_RC2_40_CBC

      @Deprecated(since="5.0.1", forRemoval=true) public static final PBEAlgorithm PBE_SHA1_RC2_40_CBC
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

  • Method Details

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