Skip to content

Instantly share code, notes, and snippets.

@awswithdotnet
Created March 3, 2022 19:19
Embed
What would you like to do?
kms Crypto AESDecrypter Decrypt Partial
AmazonKeyManagementServiceClient kmsClient = new AmazonKeyManagementServiceClient();
MemoryStream ciphertextBlob = new MemoryStream(Convert.FromBase64String((encryptionPackage.EncryptedKey)));
DecryptRequest decryptRequest = new DecryptRequest()
{
CiphertextBlob = ciphertextBlob,
KeyId = _keyId
};
DecryptResponse decryptResponse = await kmsClient.DecryptAsync(decryptRequest);
byte[] key = decryptResponse.Plaintext.ToArray();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment