Verify a signature value over data in a file.
Public Declare Function SIG_VerifyFile Lib "diCrPKI.dll" (ByVal strSignature As String, ByVal strDataFile As String, ByVal strCertOrKeyFile As String, ByVal strAlgName As String, ByVal nOptions As Long) As Long
nRet = SIG_VerifyFile(strSignature, strDataFile, strCertOrKeyFile, strAlgName, nOptions)
long __stdcall SIG_VerifyFile(const char *szSignature, const char *szDataFile, const char *szCertOrKeyFile, const char *szAlgName, long nOptions);
Zero (0) if the signature is valid; otherwise it returns a negative error code.
static bool dipki::Sig::VerifyFile (const std::string &sigStr, const std::string &dataFile, const std::string &certOrKey, Alg alg=Alg::Default, VerifyOpts opts=VerifyOpts::Default)
static Sig.file_is_verified(sig, datafile, certorkey, alg, verifyopts=VerifyOpts.DEFAULT)
This function is identical to SIG_VerifyData
except the data to be verified is in a file.
The Ed25519 and Ed448 signature algorithms are not available with this function. To verify using Ed25519 or Ed448, read in the file to a byte array and use SIG_VerifyData.
Dim strSignature As String Dim strDataFile As String Dim strCertFile As String Dim strAlgName As String Dim nRet As Long ' Signature to be verified strSignature = _ "tLy6hJadL4w9JI/A/qLCG0Vz1fWPIrPMWD8NGmA5wP7HHlUID54elztUYrpdm9RFeh0RCMJ618dw" & _ "BpgIutuZg2qQ2i9uMUYB0DvZvkyeD6MqmtVa4ihgc9SLqhigKeP+KB7voEi7PH3hpEr9Wa3kn4mb" & _ "PpeD1VHSzgu/qirjOaA=" ' File to be verified against signature = three-character ASCII string "abc" strDataFile = "abc.txt" strCertFile = "AliceRSASignByCarl.cer" strAlgName = "sha256WithRSAEncryption" ' Verify the signature over the data in the file... nRet = SIG_VerifyFile(strSignature, strDataFile, strCertFile, strAlgName, 0) Debug.Print "SIG_VerifyFile returns " & nRet & " (expecting 0)"
SIG_VerifyFile returns 0 (expecting 0)