pub enum KeyManagerRequest {
SealData {
plain_text: Buffer,
responder: KeyManagerSealDataResponder,
},
UnsealData {
cipher_text: Buffer,
responder: KeyManagerUnsealDataResponder,
},
GenerateAsymmetricKey {
key_name: String,
key: ServerEnd<AsymmetricPrivateKeyMarker>,
responder: KeyManagerGenerateAsymmetricKeyResponder,
},
GenerateAsymmetricKeyWithAlgorithm {
key_name: String,
key_algorithm: AsymmetricKeyAlgorithm,
key: ServerEnd<AsymmetricPrivateKeyMarker>,
responder: KeyManagerGenerateAsymmetricKeyWithAlgorithmResponder,
},
ImportAsymmetricPrivateKey {
data: Vec<u8>,
key_name: String,
key_algorithm: AsymmetricKeyAlgorithm,
key: ServerEnd<AsymmetricPrivateKeyMarker>,
responder: KeyManagerImportAsymmetricPrivateKeyResponder,
},
GetAsymmetricPrivateKey {
key_name: String,
key: ServerEnd<AsymmetricPrivateKeyMarker>,
responder: KeyManagerGetAsymmetricPrivateKeyResponder,
},
DeleteKey {
key_name: String,
responder: KeyManagerDeleteKeyResponder,
},
}
Variants§
SealData
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.
UnsealData
Unseal sealed data.
Unseal data previously sealed by this KMS instance.
GenerateAsymmetricKey
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
.
Fields
key: ServerEnd<AsymmetricPrivateKeyMarker>
responder: KeyManagerGenerateAsymmetricKeyResponder
GenerateAsymmetricKeyWithAlgorithm
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
.
ImportAsymmetricPrivateKey
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
.
GetAsymmetricPrivateKey
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
.
Fields
key: ServerEnd<AsymmetricPrivateKeyMarker>
responder: KeyManagerGetAsymmetricPrivateKeyResponder
DeleteKey
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.
Implementations§
Source§impl KeyManagerRequest
impl KeyManagerRequest
pub fn into_seal_data(self) -> Option<(Buffer, KeyManagerSealDataResponder)>
pub fn into_unseal_data(self) -> Option<(Buffer, KeyManagerUnsealDataResponder)>
pub fn into_generate_asymmetric_key( self, ) -> Option<(String, ServerEnd<AsymmetricPrivateKeyMarker>, KeyManagerGenerateAsymmetricKeyResponder)>
pub fn into_generate_asymmetric_key_with_algorithm( self, ) -> Option<(String, AsymmetricKeyAlgorithm, ServerEnd<AsymmetricPrivateKeyMarker>, KeyManagerGenerateAsymmetricKeyWithAlgorithmResponder)>
pub fn into_import_asymmetric_private_key( self, ) -> Option<(Vec<u8>, String, AsymmetricKeyAlgorithm, ServerEnd<AsymmetricPrivateKeyMarker>, KeyManagerImportAsymmetricPrivateKeyResponder)>
pub fn into_get_asymmetric_private_key( self, ) -> Option<(String, ServerEnd<AsymmetricPrivateKeyMarker>, KeyManagerGetAsymmetricPrivateKeyResponder)>
pub fn into_delete_key(self) -> Option<(String, KeyManagerDeleteKeyResponder)>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL