public static SecretKey generateKey ( String cipherAlgorithm ) throws NoSuchAlgorithmException { KeyGenerator keyGenerator = KeyGenerator . getInstance ( cipherAlgorithm ) ; keyGenerator . init ( secureRandom ) ; return keyGenerator . generateKey ( ) ; }
Generates a random encryption key .