Struct tink_core::keyset::Manager [−][src]
pub struct Manager { /* fields omitted */ }
Expand description
Manager manages a Keyset
-proto, with convenience methods that rotate,
disable, enable or destroy keys. Note: It is not thread-safe.
Implementations
impl Manager
[src]
impl Manager
[src]pub fn new_from_handle(kh: Handle) -> Self
[src]
pub fn new_from_handle(kh: Handle) -> Self
[src]Create a new instance from the given Handle
.
pub fn rotate(&mut self, kt: &KeyTemplate) -> Result<KeyId, TinkError>
[src]
pub fn rotate(&mut self, kt: &KeyTemplate) -> Result<KeyId, TinkError>
[src]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.
pub fn add(
&mut self,
kt: &KeyTemplate,
as_primary: bool
) -> Result<KeyId, TinkError>
[src]
pub fn add(
&mut self,
kt: &KeyTemplate,
as_primary: bool
) -> Result<KeyId, TinkError>
[src]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.
pub fn enable(&mut self, key_id: KeyId) -> Result<(), TinkError>
[src]
pub fn enable(&mut self, key_id: KeyId) -> Result<(), TinkError>
[src]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
.
pub fn disable(&mut self, key_id: KeyId) -> Result<(), TinkError>
[src]
pub fn disable(&mut self, key_id: KeyId) -> Result<(), TinkError>
[src]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
.
pub fn destroy(&mut self, key_id: KeyId) -> Result<(), TinkError>
[src]
pub fn destroy(&mut self, key_id: KeyId) -> Result<(), TinkError>
[src]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
.
pub fn delete(&mut self, key_id: KeyId) -> Result<(), TinkError>
[src]
pub fn delete(&mut self, key_id: KeyId) -> Result<(), TinkError>
[src]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.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Manager
impl Send for Manager
impl Sync for Manager
impl Unpin for Manager
impl UnwindSafe for Manager
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,