Created
March 3, 2022 19:26
-
-
Save awswithdotnet/a6a024553ef7c05cb36a6e24277efd7e to your computer and use it in GitHub Desktop.
kms Api MessageController Post
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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