[−][src]Struct tink_core::keyset::Handle
Handle
provides access to a Keyset
protobuf, to limit the exposure
of actual protocol buffers that hold sensitive key material.
Implementations
impl Handle
[src]
pub fn new(kt: &KeyTemplate) -> Result<Self, TinkError>
[src]
Create a keyset handle that contains a single fresh key generated according
to the given KeyTemplate
.
pub fn new_with_no_secrets(ks: Keyset) -> Result<Self, TinkError>
[src]
Create a new instance of Handle
using the given Keyset
which does not contain any
secret key material.
pub fn read<T>(
reader: &mut T,
master_key: Box<dyn Aead>
) -> Result<Self, TinkError> where
T: Reader,
[src]
reader: &mut T,
master_key: Box<dyn Aead>
) -> Result<Self, TinkError> where
T: Reader,
pub fn read_with_no_secrets<T>(reader: &mut T) -> Result<Self, TinkError> where
T: Reader,
[src]
T: Reader,
pub fn public(&self) -> Result<Self, TinkError>
[src]
Return a Handle
of the public keys if the managed keyset contains private keys.
pub fn write<T>(
&self,
writer: &mut T,
master_key: Box<dyn Aead>
) -> Result<(), TinkError> where
T: Writer,
[src]
&self,
writer: &mut T,
master_key: Box<dyn Aead>
) -> Result<(), TinkError> where
T: Writer,
Encrypts and writes the enclosed Keyset
.
pub fn write_with_no_secrets<T>(&self, w: &mut T) -> Result<(), TinkError> where
T: Writer,
[src]
T: Writer,
Export the keyset in h
to the given Writer
returning an error if the
keyset contains secret key material.
pub fn primitives(&self) -> Result<PrimitiveSet, TinkError>
[src]
Create a set of primitives corresponding to the keys with status=ENABLED in the keyset of
the given keyset Handle
, assuming all the corresponding key managers are present (keys
with status!=ENABLED are skipped).
The returned set is usually later "wrapped" into a class that implements the corresponding
Primitive
interface.
pub fn primitives_with_key_manager(
&self,
km: Option<Arc<dyn KeyManager>>
) -> Result<PrimitiveSet, TinkError>
[src]
&self,
km: Option<Arc<dyn KeyManager>>
) -> Result<PrimitiveSet, TinkError>
Create a set of primitives corresponding to the keys with status=ENABLED in the keyset of
the given keyset Handle
, using the given key manager (instead of registered key
managers) for keys supported by it. Keys not supported by the key manager are handled
by matching registered key managers (if present), and keys with status!=ENABLED are
skipped.
This enables custom treatment of keys, for example providing extra context (e.g. credentials for accessing keys managed by a KMS), or gathering custom monitoring/profiling information.
The returned set is usually later "wrapped" into a class that implements the corresponding
Primitive
-interface.
pub fn keyset_info(&self) -> KeysetInfo
[src]
Return KeysetInfo
representation of the managed keyset. The result does not
contain any sensitive key material.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Handle
impl Send for Handle
impl Sync for Handle
impl Unpin for Handle
impl UnwindSafe for Handle
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,