|
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 | }, |
@@ -398,6 +398,12 @@ impl TransientKeyContext { |
398 | 398 | Ok(key_material) |
399 | 399 | } |
400 | 400 |
|
| 401 | + /// Gets the name of the root key of the TransientKeyContext |
| 402 | + pub fn get_root_key_name(&mut self) -> Result<Name> { |
| 403 | + let obj_handle: ObjectHandle = self.root_key_handle.into(); |
| 404 | + self.context.tr_get_name(obj_handle) |
| 405 | + } |
| 406 | + |
401 | 407 | /// Sets the encrypt and decrypt flags on the main session used by the context. |
402 | 408 | /// |
403 | 409 | /// # Errors |
|
0 commit comments