pub struct KeyManagerProxy { /* private fields */ }
Implementations§
Source§impl KeyManagerProxy
impl KeyManagerProxy
Sourcepub fn take_event_stream(&self) -> KeyManagerEventStream
pub fn take_event_stream(&self) -> KeyManagerEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn seal_data(
&self,
plain_text: Buffer,
) -> QueryResponseFut<KeyManagerSealDataResult, DefaultFuchsiaResourceDialect>
pub fn seal_data( &self, plain_text: Buffer, ) -> QueryResponseFut<KeyManagerSealDataResult, DefaultFuchsiaResourceDialect>
Seal data to an encrypted form.
Seal data to an encrypted form. The sealed data can only be unsealed by the same KMS instance
by using UnsealData. plain_text
needs to be less than MAX_DATA_SIZE
bytes.
Sourcepub fn unseal_data(
&self,
cipher_text: Buffer,
) -> QueryResponseFut<KeyManagerUnsealDataResult, DefaultFuchsiaResourceDialect>
pub fn unseal_data( &self, cipher_text: Buffer, ) -> QueryResponseFut<KeyManagerUnsealDataResult, DefaultFuchsiaResourceDialect>
Unseal sealed data.
Unseal data previously sealed by this KMS instance.
Sourcepub fn generate_asymmetric_key(
&self,
key_name: &str,
key: ServerEnd<AsymmetricPrivateKeyMarker>,
) -> QueryResponseFut<KeyManagerGenerateAsymmetricKeyResult, DefaultFuchsiaResourceDialect>
pub fn generate_asymmetric_key( &self, key_name: &str, key: ServerEnd<AsymmetricPrivateKeyMarker>, ) -> QueryResponseFut<KeyManagerGenerateAsymmetricKeyResult, DefaultFuchsiaResourceDialect>
Generate an asymmetric key.
Generate an asymmetric key using key_name
as the unique name. key
is the generated
asymmetric key interface request. If the key_name
is not unique, you would get
KEY_ALREADY_EXISTS
. The generated key can be used to sign data. The algorithm used for
generating asymmetric key is ECDSA_SHA512_P521
.
Sourcepub fn generate_asymmetric_key_with_algorithm(
&self,
key_name: &str,
key_algorithm: AsymmetricKeyAlgorithm,
key: ServerEnd<AsymmetricPrivateKeyMarker>,
) -> QueryResponseFut<KeyManagerGenerateAsymmetricKeyWithAlgorithmResult, DefaultFuchsiaResourceDialect>
pub fn generate_asymmetric_key_with_algorithm( &self, key_name: &str, key_algorithm: AsymmetricKeyAlgorithm, key: ServerEnd<AsymmetricPrivateKeyMarker>, ) -> QueryResponseFut<KeyManagerGenerateAsymmetricKeyWithAlgorithmResult, DefaultFuchsiaResourceDialect>
Generate an asymmetric key with a specific algorithm.
Generate an asymmetric key using key_name
as the unique name and key_algorithm
as
algorithm. key
is the generated asymmetric key interface request. If the key_name
is not
unique, you would get KEY_ALREADY_EXISTS
.
Sourcepub fn import_asymmetric_private_key(
&self,
data: &[u8],
key_name: &str,
key_algorithm: AsymmetricKeyAlgorithm,
key: ServerEnd<AsymmetricPrivateKeyMarker>,
) -> QueryResponseFut<KeyManagerImportAsymmetricPrivateKeyResult, DefaultFuchsiaResourceDialect>
pub fn import_asymmetric_private_key( &self, data: &[u8], key_name: &str, key_algorithm: AsymmetricKeyAlgorithm, key: ServerEnd<AsymmetricPrivateKeyMarker>, ) -> QueryResponseFut<KeyManagerImportAsymmetricPrivateKeyResult, DefaultFuchsiaResourceDialect>
Import an asymmetric private key with a specific algorithm.
Import an asymmetric private key using key_name
as the unique name, key_algorithm
as
algorithm and data
as key data. key
is imported asymmetric key interface request. Key
data should be in asn.1 encoded DER format. If the key_name
is not unique, you would get
KEY_ALREADY_EXISTS
.
Sourcepub fn get_asymmetric_private_key(
&self,
key_name: &str,
key: ServerEnd<AsymmetricPrivateKeyMarker>,
) -> QueryResponseFut<KeyManagerGetAsymmetricPrivateKeyResult, DefaultFuchsiaResourceDialect>
pub fn get_asymmetric_private_key( &self, key_name: &str, key: ServerEnd<AsymmetricPrivateKeyMarker>, ) -> QueryResponseFut<KeyManagerGetAsymmetricPrivateKeyResult, DefaultFuchsiaResourceDialect>
Get an asymmetric private key handle.
Get an asymmetric private key handle using the key_name
. If such key is not found, would
return KEY_NOT_FOUND
.
Sourcepub fn delete_key(
&self,
key_name: &str,
) -> QueryResponseFut<KeyManagerDeleteKeyResult, DefaultFuchsiaResourceDialect>
pub fn delete_key( &self, key_name: &str, ) -> QueryResponseFut<KeyManagerDeleteKeyResult, DefaultFuchsiaResourceDialect>
Delete a key.
Delete a key for key_name
. For all the current handle to the deleted key, they would
become invalid and all following requests on those handles would return KEY_NOT_FOUND
, user
should close the invalid handles once get KEY_NOT_FOUND
error.
Trait Implementations§
Source§impl Clone for KeyManagerProxy
impl Clone for KeyManagerProxy
Source§fn clone(&self) -> KeyManagerProxy
fn clone(&self) -> KeyManagerProxy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for KeyManagerProxy
impl Debug for KeyManagerProxy
Source§impl KeyManagerProxyInterface for KeyManagerProxy
impl KeyManagerProxyInterface for KeyManagerProxy
type SealDataResponseFut = QueryResponseFut<Result<Buffer, Error>>
type UnsealDataResponseFut = QueryResponseFut<Result<Buffer, Error>>
type GenerateAsymmetricKeyResponseFut = QueryResponseFut<Result<(), Error>>
type GenerateAsymmetricKeyWithAlgorithmResponseFut = QueryResponseFut<Result<(), Error>>
type ImportAsymmetricPrivateKeyResponseFut = QueryResponseFut<Result<(), Error>>
type GetAsymmetricPrivateKeyResponseFut = QueryResponseFut<Result<(), Error>>
type DeleteKeyResponseFut = QueryResponseFut<Result<(), Error>>
fn seal_data(&self, plain_text: Buffer) -> Self::SealDataResponseFut
fn unseal_data(&self, cipher_text: Buffer) -> Self::UnsealDataResponseFut
fn generate_asymmetric_key( &self, key_name: &str, key: ServerEnd<AsymmetricPrivateKeyMarker>, ) -> Self::GenerateAsymmetricKeyResponseFut
fn generate_asymmetric_key_with_algorithm( &self, key_name: &str, key_algorithm: AsymmetricKeyAlgorithm, key: ServerEnd<AsymmetricPrivateKeyMarker>, ) -> Self::GenerateAsymmetricKeyWithAlgorithmResponseFut
fn import_asymmetric_private_key( &self, data: &[u8], key_name: &str, key_algorithm: AsymmetricKeyAlgorithm, key: ServerEnd<AsymmetricPrivateKeyMarker>, ) -> Self::ImportAsymmetricPrivateKeyResponseFut
fn get_asymmetric_private_key( &self, key_name: &str, key: ServerEnd<AsymmetricPrivateKeyMarker>, ) -> Self::GetAsymmetricPrivateKeyResponseFut
fn delete_key(&self, key_name: &str) -> Self::DeleteKeyResponseFut
Source§impl Proxy for KeyManagerProxy
impl Proxy for KeyManagerProxy
Source§type Protocol = KeyManagerMarker
type Protocol = KeyManagerMarker
Proxy
controls.Source§fn from_channel(inner: AsyncChannel) -> Self
fn from_channel(inner: AsyncChannel) -> Self
Source§fn into_channel(self) -> Result<AsyncChannel, Self>
fn into_channel(self) -> Result<AsyncChannel, Self>
Source§fn as_channel(&self) -> &AsyncChannel
fn as_channel(&self) -> &AsyncChannel
§fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
Auto Trait Implementations§
impl Freeze for KeyManagerProxy
impl !RefUnwindSafe for KeyManagerProxy
impl Send for KeyManagerProxy
impl Sync for KeyManagerProxy
impl Unpin for KeyManagerProxy
impl !UnwindSafe for KeyManagerProxy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)