rust/pv: User-data signing and verifying

Add the ability to generate signed user-data and to verify the
signature.

Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Steffen Eiden
2024-01-30 12:55:56 +01:00
committed by Jan Höppner
parent f36c34038b
commit 34bef977e8
11 changed files with 798 additions and 3 deletions
+7
View File
@@ -67,6 +67,13 @@ impl AddSecretMagic {
let kind = UserDataType::try_from(kind)?;
Ok(Self::from(kind))
}
/// Returns the [`UserDataType`] of this [`AddSecretMagic`].
pub fn kind(&self) -> UserDataType {
// Panic: Will never panic. The value is cheched during construcion of the object for
// beeing one of the enum values.
self.kind.get().try_into().unwrap()
}
}
/// Types of (non architectured) user data for an add-secret request