Skip to content

Commit c7e6393

Browse files
tss-esapi/transient: get_root_key_name
Expose the root key name of a TransientKeyContext. This may be used for verifying previously generated keys. Signed-off-by: Tomás González <[email protected]>
1 parent 40a28ca commit c7e6393

File tree

1 file changed

+8
-2
lines changed
  • tss-esapi/src/abstraction/transient

1 file changed

+8
-2
lines changed

tss-esapi/src/abstraction/transient/mod.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
use crate::{
1010
attributes::{ObjectAttributesBuilder, SessionAttributesBuilder},
1111
constants::{tss::*, SessionType, Tss2ResponseCodeKind},
12-
handles::{KeyHandle, SessionHandle},
12+
handles::{KeyHandle, ObjectHandle, SessionHandle},
1313
interface_types::{
1414
algorithm::{HashingAlgorithm, PublicAlgorithm},
1515
ecc::EccCurve,
1616
key_bits::RsaKeyBits,
1717
resource_handles::Hierarchy,
1818
},
1919
structures::{
20-
Auth, CreateKeyResult, Data, Digest, EccPoint, EccScheme, Public, PublicBuilder,
20+
Auth, CreateKeyResult, Data, Digest, EccPoint, EccScheme, Name, Public, PublicBuilder,
2121
PublicEccParametersBuilder, PublicKeyRsa, PublicRsaParametersBuilder, RsaExponent,
2222
RsaScheme, Signature, SignatureScheme, SymmetricDefinitionObject, VerifiedTicket,
2323
},
@@ -393,6 +393,12 @@ impl TransientKeyContext {
393393
Ok(key_material)
394394
}
395395

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+
396402
/// Sets the encrypt and decrypt flags on the main session used by the context.
397403
///
398404
/// # Errors

0 commit comments

Comments
 (0)