code: public static SecretKey deserializeSecretKey(byte[] keyData, String algorithm) {
          LOGGER.trace("deserialize secret key from data using algorithm \"{}\"", algorithm);
          return new SecretKeySpec(keyData, algorithm);
      }
docs: converts a byte[] that originally was created using {@link SecretKey#getEncoded()} back to the corresponding
  instance.
  
  Example: CipherUtils.deserializeSecretKey(data, "AES")