Skip to content

Commit

Permalink
Merge pull request #511 from parallaxsecond/tg/root-key-name
Browse files Browse the repository at this point in the history
tss-esapi/transient: get_root_key_name
  • Loading branch information
gowthamsk-arm authored Mar 14, 2024
2 parents fec4ea7 + 18fa201 commit 7899a72
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tss-esapi/src/abstraction/transient/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ use crate::{
attributes::{ObjectAttributesBuilder, SessionAttributesBuilder},
constants::{SessionType, TpmFormatZeroError},
error::{TpmFormatZeroResponseCode, TpmResponseCode},
handles::{KeyHandle, SessionHandle},
handles::{KeyHandle, ObjectHandle, SessionHandle},
interface_types::{
algorithm::{HashingAlgorithm, PublicAlgorithm},
ecc::EccCurve,
key_bits::RsaKeyBits,
reserved_handles::Hierarchy,
},
structures::{
Auth, CreateKeyResult, Data, Digest, EccPoint, EccScheme, Public, PublicBuilder,
Auth, CreateKeyResult, Data, Digest, EccPoint, EccScheme, Name, Public, PublicBuilder,
PublicEccParametersBuilder, PublicKeyRsa, PublicRsaParametersBuilder, RsaExponent,
RsaScheme, Signature, SignatureScheme, SymmetricDefinitionObject, VerifiedTicket,
},
Expand Down Expand Up @@ -386,6 +386,12 @@ impl TransientKeyContext {
Ok(key_material)
}

/// Gets the name of the root key of the TransientKeyContext
pub fn get_root_key_name(&mut self) -> Result<Name> {
let obj_handle: ObjectHandle = self.root_key_handle.into();
self.context.tr_get_name(obj_handle)
}

/// Sets the encrypt and decrypt flags on the main session used by the context.
///
/// # Errors
Expand Down

0 comments on commit 7899a72

Please sign in to comment.