Keystore 2.0: Revisit Key Parameters

key_parameters.rs provides an internal representation of key parameters
and conversion functions between the internal representation and both
the AIDL KeyMint key parameters and the persistent storage back end.

Previously, we had only the former conversion bootstrapped from a list
description of the key parameters. Now we have only a single list
from which all conversions and the KeyParameterValue enum itself are
bootstrapped.

In addition, the following improvements were made:
* convert_to/from_wire was replaced with the more idiomatic
  implementation of From and Into traits.
* A new test is auto generated from the key parameter list verifying
  that the associated union field of the keymint KeyParameterValue
  matches the encoded tag type of the keymint Tag value.

Test: keystore2_test
Change-Id: I3e5be176ff247ba0c01316981ba9c377f73be63e
2 files changed