Class SecretKeyUtil


  • public class SecretKeyUtil
    extends Object
    Cryptography key handling util
    Since:
    2.5.0
    Author:
    imre.scheffer
    • Method Detail

      • defaultAES256SecretKeySpec

        public static SecretKeySpec defaultAES256SecretKeySpec​(char[] password)
                                                        throws hu.icellmobilsoft.coffee.dto.exception.BaseException
        Create secret key, where the following values are set:
        Parameters:
        password - string to encode
        Returns:
        SecretKeySpec
        Throws:
        hu.icellmobilsoft.coffee.dto.exception.BaseException - any exception
      • AES256SecretKeySpec

        public static SecretKeySpec AES256SecretKeySpec​(char[] password,
                                                        byte[] salt,
                                                        int iteration,
                                                        int keyLength,
                                                        String secretKeyFactoryAlgorithm,
                                                        String secretKeySpecAlgorithm)
                                                 throws hu.icellmobilsoft.coffee.dto.exception.BaseException
        Create secret key
        Parameters:
        password - string to encode
        salt - salt source
        iteration - iteration count
        keyLength - he to-be-derived key length
        secretKeyFactoryAlgorithm - the standard name of the requested secret-key algorithm
        secretKeySpecAlgorithm - the name of the secret-key algorithm to be associated with the given key material.
        Returns:
        secret key from the given byte array
        Throws:
        hu.icellmobilsoft.coffee.dto.exception.BaseException - any exception