Enum PKCS5AlgorithmIdentifier

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      AES_128_CBC_PAD
      The algorithm identifier for the 128-bit AES/CBC/PKCS5Padding cipher transformation.
      AES_192_CBC_PAD
      The algorithm identifier for the 192-bit AES/CBC/PKCS5Padding cipher transformation.
      AES_256_CBC_PAD
      The algorithm identifier for the 256-bit AES/CBC/PKCS5Padding cipher transformation.
      DES_EDE3_CBC_PAD
      The algorithm identifier for the DESede/CBC/PKCS5Padding cipher transformation.
      HMAC_SHA_1
      The algorithm identifier for the HMAC-SHA-1 pseudorandom function, which may be used in conjunction with the PBKDF2 key derivation function.
      HMAC_SHA_224
      The algorithm identifier for the HMAC-SHA-224 pseudorandom function, which may be used in conjunction with the PBKDF2 key derivation function.
      HMAC_SHA_256
      The algorithm identifier for the HMAC-SHA-256 pseudorandom function, which may be used in conjunction with the PBKDF2 key derivation function.
      HMAC_SHA_384
      The algorithm identifier for the HMAC-SHA-384 pseudorandom function, which may be used in conjunction with the PBKDF2 key derivation function.
      HMAC_SHA_512
      The algorithm identifier for the HMAC-SHA-512 pseudorandom function, which may be used in conjunction with the PBKDF2 key derivation function.
      PBES2
      The algorithm identifier for the PBES2 encryption scheme.
      PBKDF2
      The algorithm identifier for the PBKDF2 key derivation function, which is intended to be used by the PBES2 encryption scheme.
    • Enum Constant Detail

      • PBES2

        public static final PKCS5AlgorithmIdentifier PBES2
        The algorithm identifier for the PBES2 encryption scheme. This scheme is defined in RFC 8018 section 6.2, and the identifier is defined in appendix A.4 of that specification.
      • PBKDF2

        public static final PKCS5AlgorithmIdentifier PBKDF2
        The algorithm identifier for the PBKDF2 key derivation function, which is intended to be used by the PBES2 encryption scheme. This identifier is described in RFC 8018 appendix A.2.
      • HMAC_SHA_1

        public static final PKCS5AlgorithmIdentifier HMAC_SHA_1
        The algorithm identifier for the HMAC-SHA-1 pseudorandom function, which may be used in conjunction with the PBKDF2 key derivation function. This identifier is described in RFC 8018 appendix B.1.1.
      • HMAC_SHA_224

        public static final PKCS5AlgorithmIdentifier HMAC_SHA_224
        The algorithm identifier for the HMAC-SHA-224 pseudorandom function, which may be used in conjunction with the PBKDF2 key derivation function. This identifier is described in RFC 8018 appendix B.1.2.
      • HMAC_SHA_256

        public static final PKCS5AlgorithmIdentifier HMAC_SHA_256
        The algorithm identifier for the HMAC-SHA-256 pseudorandom function, which may be used in conjunction with the PBKDF2 key derivation function. This identifier is described in RFC 8018 appendix B.1.2.
      • HMAC_SHA_384

        public static final PKCS5AlgorithmIdentifier HMAC_SHA_384
        The algorithm identifier for the HMAC-SHA-384 pseudorandom function, which may be used in conjunction with the PBKDF2 key derivation function. This identifier is described in RFC 8018 appendix B.1.2.
      • HMAC_SHA_512

        public static final PKCS5AlgorithmIdentifier HMAC_SHA_512
        The algorithm identifier for the HMAC-SHA-512 pseudorandom function, which may be used in conjunction with the PBKDF2 key derivation function. This identifier is described in RFC 8018 appendix B.1.2.
      • DES_EDE3_CBC_PAD

        public static final PKCS5AlgorithmIdentifier DES_EDE3_CBC_PAD
        The algorithm identifier for the DESede/CBC/PKCS5Padding cipher transformation. This identifier is described in RFC 8018 appendix B.2.2.
      • AES_128_CBC_PAD

        public static final PKCS5AlgorithmIdentifier AES_128_CBC_PAD
        The algorithm identifier for the 128-bit AES/CBC/PKCS5Padding cipher transformation. This identifier is described in RFC 8018 appendix B.2.2.
      • AES_192_CBC_PAD

        public static final PKCS5AlgorithmIdentifier AES_192_CBC_PAD
        The algorithm identifier for the 192-bit AES/CBC/PKCS5Padding cipher transformation. This identifier is described in RFC 8018 appendix C.
      • AES_256_CBC_PAD

        public static final PKCS5AlgorithmIdentifier AES_256_CBC_PAD
        The algorithm identifier for the 256-bit AES/CBC/PKCS5Padding cipher transformation. This identifier is described in RFC 8018 appendix C.
    • Method Detail

      • values

        public static PKCS5AlgorithmIdentifier[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (PKCS5AlgorithmIdentifier c : PKCS5AlgorithmIdentifier.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static PKCS5AlgorithmIdentifier valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getOID

        @NotNull
        public OID getOID()
        Retrieves the OID for this PKCS #5 algorithm identifier.
        Returns:
        The OID for this PKCS #5 algorithm identifier.
      • getName

        @NotNull
        public java.lang.String getName()
        Retrieves the name for the algorithm.
        Returns:
        The name for the algorithm.
      • getDescription

        @NotNull
        public java.lang.String getDescription()
        Retrieves a human-readable description for the algorithm.
        Returns:
        A human-readable description for the algorithm.
      • forOID

        @Nullable
        public static PKCS5AlgorithmIdentifier forOID​(@NotNull
                                                      OID oid)
        Retrieves the PKCS #5 algorithm identifier with the specified OID.
        Parameters:
        oid - The OID for the PKCS #5 algorithm identifier instance to retrieve. It must not be null.
        Returns:
        The appropriate PKCS #5 algorithm identifier instance, or null if the provided OID does not reference a known PKCS #5 algorithm identifier.
      • forName

        @Nullable
        public static PKCS5AlgorithmIdentifier forName​(@NotNull
                                                       java.lang.String name)
        Retrieves the PKCS #5 algorithm identifier with the specified name.
        Parameters:
        name - The name for the PKCS #5 algorithm identifier to retrieve. It must not be null.
        Returns:
        The appropriate PKCS #5 algorithm identifier instance, or null if the provided name does not reference a known PKCS #5 algorithm identifier.
      • getNameOrOID

        @NotNull
        public static java.lang.String getNameOrOID​(@NotNull
                                                    OID oid)
        Retrieves the human-readable name for the PKCS #5 algorithm identifier value with the provided OID, or a string representation of the OID if there is no value with that OID.
        Parameters:
        oid - The OID for the PKCS #5 algorithm identifier to retrieve.
        Returns:
        The human-readable name for the PKCS #5 algorithm identifier value with the provided OID, or a string representation of the OID if there is no value with that OID.
      • getPseudorandomFunctions

        @NotNull
        public static java.util.Set<PKCS5AlgorithmIdentifiergetPseudorandomFunctions()
        Retrieves the set of PKCS #5 algorithm identifiers that represent pseudorandom functions.
        Returns:
        The set of PKCS #5 algorithm identifiers that represent pseudorandom functions.
      • getPBKDF2SecretKeyFactoryAlgorithmForPseudorandomFunction

        @Nullable
        public static java.lang.String getPBKDF2SecretKeyFactoryAlgorithmForPseudorandomFunction​(@NotNull
                                                                                                 PKCS5AlgorithmIdentifier identifier)
        Retrieves the name of the secret key factory algorithm that should be used to create a PBKDF2 key factory that uses the specified pseudorandom function.
        Parameters:
        identifier - The PKCS #5 algorithm identifier that represents the pseudorandom function for which to obtain the name of the corresponding PBKDF2 secret key factory algorithm. It must not be null.
        Returns:
        The name of the PBKDF2 key factory algorithm that uses the specified pseudorandom function, or null if the provided identifier does not represent a known pseudorandom function.
      • getCipherTransformations

        @NotNull
        public static java.util.Set<PKCS5AlgorithmIdentifiergetCipherTransformations()
        Retrieves the set of PKCS #5 algorithm identifiers that represent cipher transformations.
        Returns:
        The set of PKCS #5 algorithm identifiers that represent cipher transformations.
      • getCipherAlgorithmName

        @Nullable
        public static java.lang.String getCipherAlgorithmName​(@NotNull
                                                              PKCS5AlgorithmIdentifier identifier)
        Retrieves the name of the cipher algorithm that should be used when creating a secret key for the specified cipher transformation.
        Parameters:
        identifier - The PKCS #5 algorithm identifier that represents the cipher transformation for which to obtain the name of the corresponding cipher algorithm. It must not be null.
        Returns:
        The name of the cipher algorithm that should be used when creating a secret key for the specified cipher transformation, or null if the provided identifier does not represent a known cipher transformation.
      • getCipherTransformationName

        @Nullable
        public static java.lang.String getCipherTransformationName​(@NotNull
                                                                   PKCS5AlgorithmIdentifier identifier)
        Retrieves the name of the cipher transformation that should be used when creating a cipher instance for the specified cipher transformation.
        Parameters:
        identifier - The PKCS #5 algorithm identifier that represents the cipher transformation for which to obtain the name. It must not be null.
        Returns:
        The name of the cipher transformation that should be used when creating a cipher instance for the specified cipher transformation, or null if the provided identifier does not represent a known cipher transformation.
      • getCipherKeySizeBits

        @Nullable
        public static java.lang.Integer getCipherKeySizeBits​(@NotNull
                                                             PKCS5AlgorithmIdentifier identifier)
        Retrieves the key size, in bits, that should be used when creating a secret key for the specified cipher transformation.
        Parameters:
        identifier - The PKCS #5 algorithm identifier that represents the cipher transformation for which to obtain the key size. It must not be null.
        Returns:
        The key size, in bits, that should be used when creating a secret key for the specified cipher transformation, or null if the provided identifier does not represent a known cipher transformation.
      • toString

        @NotNull
        public java.lang.String toString()
        Retrieves a string representation of this PKCS #5 algorithm identifier.
        Overrides:
        toString in class java.lang.Enum<PKCS5AlgorithmIdentifier>
        Returns:
        A string representation of this PKCS #5 algorithm identifier.