File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
tss-esapi/src/structures/tagged Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ use log::error;
21
21
use std:: convert:: { TryFrom , TryInto } ;
22
22
use tss_esapi_sys:: { TPMU_PUBLIC_ID , TPMU_PUBLIC_PARMS } ;
23
23
24
+ use super :: symmetric:: SymmetricDefinitionObject ;
25
+
24
26
/// A builder for the [Public] type.
25
27
#[ derive( Debug , Clone ) ]
26
28
pub struct PublicBuilder {
@@ -374,6 +376,16 @@ impl Public {
374
376
}
375
377
}
376
378
379
+ /// Returns the name symmetric definition object if available
380
+ pub fn symmetric_algorithm ( & self ) -> Result < SymmetricDefinitionObject > {
381
+ match self {
382
+ Public :: Rsa { parameters, .. } => Ok ( parameters. symmetric_definition_object ( ) ) ,
383
+ Public :: KeyedHash { .. } => Err ( Error :: local_error ( WrapperErrorKind :: InvalidParam ) ) ,
384
+ Public :: Ecc { parameters, .. } => Ok ( parameters. symmetric_definition_object ( ) ) ,
385
+ Public :: SymCipher { parameters, .. } => Ok ( parameters. symmetric_definition_object ( ) ) ,
386
+ }
387
+ }
388
+
377
389
/// Returns the auth policy digest.
378
390
pub fn auth_policy ( & self ) -> & Digest {
379
391
match self {
You can’t perform that action at this time.
0 commit comments