|
9 | 9 | use crate::{ |
10 | 10 | attributes::{ObjectAttributesBuilder, SessionAttributesBuilder}, |
11 | 11 | constants::{tss::*, SessionType, Tss2ResponseCodeKind}, |
12 | | - handles::{KeyHandle, SessionHandle}, |
| 12 | + handles::{KeyHandle, ObjectHandle, SessionHandle}, |
13 | 13 | interface_types::{ |
14 | 14 | algorithm::{HashingAlgorithm, PublicAlgorithm}, |
15 | 15 | ecc::EccCurve, |
16 | 16 | key_bits::RsaKeyBits, |
17 | 17 | resource_handles::Hierarchy, |
18 | 18 | }, |
19 | 19 | structures::{ |
20 | | - Auth, CreateKeyResult, Data, Digest, EccPoint, EccScheme, Public, PublicBuilder, |
| 20 | + Auth, CreateKeyResult, Data, Digest, EccPoint, EccScheme, Name, Public, PublicBuilder, |
21 | 21 | PublicEccParametersBuilder, PublicKeyRsa, PublicRsaParametersBuilder, RsaExponent, |
22 | 22 | RsaScheme, Signature, SignatureScheme, SymmetricDefinitionObject, VerifiedTicket, |
23 | 23 | }, |
@@ -393,6 +393,12 @@ impl TransientKeyContext { |
393 | 393 | Ok(key_material) |
394 | 394 | } |
395 | 395 |
|
| 396 | + /// Gets the name of the root key of the TransientKeyContext |
| 397 | + pub fn get_root_key_name(&mut self) -> Result<Name> { |
| 398 | + let obj_handle: ObjectHandle = self.root_key_handle.into(); |
| 399 | + self.context.tr_get_name(obj_handle) |
| 400 | + } |
| 401 | + |
396 | 402 | /// Sets the encrypt and decrypt flags on the main session used by the context. |
397 | 403 | /// |
398 | 404 | /// # Errors |
|
0 commit comments