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
diff --git a/keystore2/src/utils.rs b/keystore2/src/utils.rs
index 7a6d6d7..d50f70e 100644
--- a/keystore2/src/utils.rs
+++ b/keystore2/src/utils.rs
@@ -19,9 +19,9 @@
 //! This module implements utility functions used by the Keystore 2.0 service
 //! implementation.
 
+use crate::error::Error;
 use crate::permission;
 use crate::permission::{KeyPerm, KeyPermSet, KeystorePerm};
-use crate::{error::Error, key_parameter::KeyParameterValue};
 use android_hardware_security_keymint::aidl::android::hardware::security::keymint::{
     KeyCharacteristics::KeyCharacteristics, SecurityLevel::SecurityLevel,
 };
@@ -119,17 +119,9 @@
     key_characteristics
         .hardwareEnforced
         .into_iter()
-        .map(|aidl_kp| {
-            crate::key_parameter::KeyParameter::new(
-                KeyParameterValue::convert_from_wire(aidl_kp),
-                hw_security_level,
-            )
-        })
+        .map(|aidl_kp| crate::key_parameter::KeyParameter::new(aidl_kp.into(), hw_security_level))
         .chain(key_characteristics.softwareEnforced.into_iter().map(|aidl_kp| {
-            crate::key_parameter::KeyParameter::new(
-                KeyParameterValue::convert_from_wire(aidl_kp),
-                SecurityLevel::SOFTWARE,
-            )
+            crate::key_parameter::KeyParameter::new(aidl_kp.into(), SecurityLevel::SOFTWARE)
         }))
         .collect()
 }