Skip to content

Instantly share code, notes, and snippets.

@awswithdotnet
Created March 3, 2022 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awswithdotnet/a6a024553ef7c05cb36a6e24277efd7e to your computer and use it in GitHub Desktop.
Save awswithdotnet/a6a024553ef7c05cb36a6e24277efd7e to your computer and use it in GitHub Desktop.
kms Api MessageController Post
[HttpPost]
public async Task<IActionResult> ReceiveMessage(EncryptionPackage encryptionPackage){
if(encryptionPackage == null || encryptionPackage.CipherText == null || encryptionPackage.EncryptedKey == null){
return BadRequest();
}
IDecrypter decrypter = new AESDecrypter();
string plainText = await decrypter.Decrypt(encryptionPackage);
Console.WriteLine("Decrypted:" + plainText);
return Ok(plainText);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment