pub struct TransientKeyContextBuilder { /* private fields */ }
Expand description

Build a new TransientKeyContext.

Default values

  • TCTI: Device TCTI
  • Hierarchy: Owner hierarchy
  • Root key size: 2048 bits
  • Root key authentication size: 32 bytes
  • Hierarchy authentication value: Empty array of bytes
  • Session encryption cipher: 256 bit AES in CFB mode
  • Session hash algorithm: SHA256

Implementations

Create a new builder.

Define the TCTI name configuration to be used by the client.

Set the auth values for any hierarchies that will be used

Define which hierarchy will be used for the keys being managed.

Choose length in bits of primary key that will serve as parent to all user keys.

Choose authentication value length (in bytes) for primary key.

Define the cipher to be used within this context as a default.

Currently this default is used for:

  • securing command parameters using session-based encryption
  • encrypting all user keys using the primary key

Define the cipher to be used by sessions for hashing commands.

Bootstrap the TransientKeyContext.

The root key is created as a primary key in the provided hierarchy and thus authentication is needed for said hierarchy. The authentication valuei for the key is generated by the TPM itself, with a configurable length, and never exposed outside the context.

Warning

It is the responsibility of the client to ensure that the context can be initialized safely, threading-wise by choosing the correct TCTI. See the Warning notice of the Context structure for more information.

Constraints
  • root_key_size must be 1024, 2048, 3072 or 4096
  • root_key_auth_size must be at most 32
Errors
  • errors are returned if any method calls return an error: Context::get_random, Context::start_auth_session, Context::create_primary, Context::flush_context, Context::set_handle_auth
  • if the root key authentication size is given greater than 32 or if the root key size is not 1024, 2048, 3072 or 4096, a InvalidParam wrapper error is returned

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Drops the content pointed by this pointer and frees it. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.