@Deprecated private static SecretKey generatePBEKey(char[] passphraseOrPin,byte[] salt,String algorthm,int iterations,int keyLength) throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchProviderException {
  if (iterations == 0) {
    iterations=1000;
  }
  SecretKeyFactory secretKeyFactory=SecretKeyFactory.getInstance(algorthm,PROVIDER);
  KeySpec keySpec=new PBEKeySpec(passphraseOrPin,salt,iterations,keyLength);
  SecretKey secretKey=secretKeyFactory.generateSecret(keySpec);
  return secretKey;
}

@ Deprecated private static SecretKey generatePBEKey ( char [ ] passphraseOrPin , byte [ ] salt , String algorthm , int iterations , int keyLength ) throws NoSuchAlgorithmException , InvalidKeySpecException , NoSuchProviderException { if ( iterations == 0 ) { iterations = 1000 ; } SecretKeyFactory secretKeyFactory = SecretKeyFactory . getInstance ( algorthm , PROVIDER ) ; KeySpec keySpec = new PBEKeySpec ( passphraseOrPin , salt , iterations , keyLength ) ; SecretKey secretKey = secretKeyFactory . generateSecret ( keySpec ) ; return secretKey ; }
derive a secure key based on the passphraseorpin
