Struct aws_manager::kms::Manager
source · [−]pub struct Manager { /* private fields */ }
Expand description
Implements AWS KMS manager.
Implementations
sourceimpl Manager
impl Manager
pub fn new(shared_config: &AwsSdkConfig) -> Self
sourcepub async fn create_key(&self, key_desc: &str) -> Result<Key>
pub async fn create_key(&self, key_desc: &str) -> Result<Key>
Creates an AWS KMS CMK.
sourcepub async fn schedule_to_delete(&self, key_id: &str) -> Result<()>
pub async fn schedule_to_delete(&self, key_id: &str) -> Result<()>
Schedules to delete a KMS CMK.
sourcepub async fn encrypt(
&self,
key_id: &str,
spec: Option<EncryptionAlgorithmSpec>,
plaintext: Vec<u8>
) -> Result<Vec<u8>>
pub async fn encrypt(
&self,
key_id: &str,
spec: Option<EncryptionAlgorithmSpec>,
plaintext: Vec<u8>
) -> Result<Vec<u8>>
Encrypts data. The maximum size of the data KMS can encrypt is 4096 bytes for “SYMMETRIC_DEFAULT” encryption algorithm. To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. ref. https://docs.aws.amazon.com/kms/latest/APIReference/API_Encrypt.html
sourcepub async fn decrypt(
&self,
key_id: &str,
spec: Option<EncryptionAlgorithmSpec>,
ciphertext: Vec<u8>
) -> Result<Vec<u8>>
pub async fn decrypt(
&self,
key_id: &str,
spec: Option<EncryptionAlgorithmSpec>,
ciphertext: Vec<u8>
) -> Result<Vec<u8>>
Decrypts data. The maximum length of “ciphertext” is 6144 bytes. ref. https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html
sourcepub async fn encrypt_file(
&self,
key_id: &str,
spec: Option<EncryptionAlgorithmSpec>,
src_file: &str,
dst_file: &str
) -> Result<()>
pub async fn encrypt_file(
&self,
key_id: &str,
spec: Option<EncryptionAlgorithmSpec>,
src_file: &str,
dst_file: &str
) -> Result<()>
Encrypts data from a file and save the ciphertext to the other file.
sourcepub async fn decrypt_file(
&self,
key_id: &str,
spec: Option<EncryptionAlgorithmSpec>,
src_file: &str,
dst_file: &str
) -> Result<()>
pub async fn decrypt_file(
&self,
key_id: &str,
spec: Option<EncryptionAlgorithmSpec>,
src_file: &str,
dst_file: &str
) -> Result<()>
Decrypts data from a file and save the plaintext to the other file.
sourcepub async fn generate_data_key(
&self,
key_id: &str,
spec: Option<DataKeySpec>
) -> Result<DEK>
pub async fn generate_data_key(
&self,
key_id: &str,
spec: Option<DataKeySpec>
) -> Result<DEK>
Generates a data-encryption key. The default key spec is AES_256 generate a 256-bit symmetric key. ref. https://docs.aws.amazon.com/kms/latest/APIReference/API_GenerateDataKey.html
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more