pub struct KmsServiceHook { /* private fields */ }Expand description
Hook used by service crates that need to call KMS for encryption / decryption without going through the AWS-shaped HTTP layer.
Implementations§
Source§impl KmsServiceHook
impl KmsServiceHook
pub fn new(state: SharedKmsState, usage: SharedKmsUsageState) -> Self
Sourcepub fn encrypt(
&self,
account_id: &str,
region: &str,
key_id: &str,
plaintext: &[u8],
service_principal: &str,
encryption_context: HashMap<String, String>,
) -> Result<String, KmsHookError>
pub fn encrypt( &self, account_id: &str, region: &str, key_id: &str, plaintext: &[u8], service_principal: &str, encryption_context: HashMap<String, String>, ) -> Result<String, KmsHookError>
Encrypt plaintext under key_id (raw id, ARN, alias, or
aws/<service> AWS-managed alias). Records the call as a
GenerateDataKey-shaped usage record and returns the base64
ciphertext envelope.
Auto Trait Implementations§
impl !RefUnwindSafe for KmsServiceHook
impl !UnwindSafe for KmsServiceHook
impl Freeze for KmsServiceHook
impl Send for KmsServiceHook
impl Sync for KmsServiceHook
impl Unpin for KmsServiceHook
impl UnsafeUnpin for KmsServiceHook
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
Mutably borrows from an owned value. Read more