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

Manager manages a Keyset-proto, with convenience methods that rotate, disable, enable or destroy keys. Note: It is not thread-safe.

Implementations

Create a new instance with an empty Keyset.

Create a new instance from the given Handle.

Generate a fresh key using the given key template and set the new key as the primary key. The key that was primary prior to rotation remains Enabled. Returns the key ID of the new primary key.

Generate a fresh key using the given key template, and optionally set the new key as the primary key. Returns the key ID of the added key.

Create a new Handle for the managed keyset.

Sets the status of the specified key to KeyStatusType::Enabled. Succeeds only if before the call the specified key has status KeyStatusType::Disabled or KeyStatusType::Enabled.

Sets the status of the specified key to KeyStatusType::Disabled. Succeeds only if before the call the specified key is not primary and has status KeyStatusType::Disabled or KeyStatusType::Enabled.

Sets the status of the specified key to KeyStatusType::Destroyed, and removes the corresponding key material, if any. Succeeds only if before the call the specified key is not primary and has status KeyStatusType::Disabled, or KeyStatusType::Enabled, or KeyStatusType::Destroyed.

Removes the specifed key from the managed keyset. Succeeds only if the specified key is not primary. After deletion the keyset contains one key fewer.

Sets the specified key as the primary. Succeeds only if the specified key is Enabled.

Return the count of all keys in the keyset.

Trait Implementations

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

Returns the argument unchanged.

Calls U::from(self).

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

Should always be Self

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.