C#C
C#8mo ago
VoidPointer

Problem Posting Encrypted Image from Postman to ASP.NET API Endpoint

I need a sanity check, please. I'm supposed to post a passport image encoded as base64 then encrypted. Then the endpoint gets the original document back like this:
validateDocument.base64_document = Convert.ToBase64String(cryptLib.decryptByte(Convert.FromBase64String(validatePassportRequest.Base64Document), decryptionKey, decryptionVector, out decryptErr1)); 

Now because I can't encode the document in Postman, I'm doing it like this using the same keys that are used to decrypt it, and this has always worked before for posting encrypted documents from Postman, but without all the base64 baggage:
var encDoc = cryptLib.encrypt(validatePassportRequest.Base64Document, decryptionKey, decryptionVector);
var b64Doc = Convert.ToBase64String(Security.GetBytes(encDoc));

Then I just paste b64Doc into my Postman request variable.
Was this page helpful?