Created
October 30, 2023 13:37
-
-
Save bjoerntx/7b811ce8ea069649d3eb5ea9dd0b36cf to your computer and use it in GitHub Desktop.
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
public IActionResult Validate([FromForm] IFormFile file) | |
{ | |
if (file == null) | |
{ | |
return NotFound(); | |
} | |
byte[] bPDF = GetBytesFromFormFile(file); | |
var uploadedEnvelope = ExtractEnvelopeFromPDF(bPDF); | |
if (uploadedEnvelope == null) | |
{ | |
return NotFound(); | |
} | |
var envelopes = LoadEnvelopesFromJson(); | |
var envelope = envelopes.FirstOrDefault(e => e.DocumentId == uploadedEnvelope.DocumentId); | |
if (envelope != null && envelope.SignatureHash == uploadedEnvelope.SignatureHash) | |
{ | |
return View(true); | |
} | |
return View(false); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment