Reads the content from a CMS signed-data object file.
Public Declare Function CMS_ReadSigData Lib "diCrPKI.dll"
(ByVal strFileOut As String, ByVal strFileIn As String,
ByVal nOptions As Long) As Long
nRet = CMS_ReadSigData(strFileOut, strFileIn,
nOptions) As Long
long __stdcall CMS_ReadSigData(const char *szFileOut, const char *szFileIn, long nOptions);
If successful, the return value is a positive number indicating the number of bytes in the content; otherwise it returns a negative error code.
static int dipki::Cms::ReadSigDataToFile (const std::string &outputFile, const std::string &inputFile, bool bigFile=false)
static Cms.read_sigdata_to_file(outputfile, inputfile, bigfile=False)
This function extracts the signed data from the signed-data CMS object without making any attempt to verify it. Any existing file with the same name as the specified output will be overwritten without further warning.
This function automatically checks for and reads "naked" SignedData files as per PKCS#7 version 1.6 [PKCS7-EXT] as well as the default SignedData objects properly encapsulated in an outerContentInfo as per the S/MIME standard.
This example reads the content from the signed CMS object created in the example for CMS_MakeSigData above. The output is written directly to a file and should contain the 28 bytes "This is some sample content."
Dim nRet As Long
Dim strFileIn As String
Dim strFileOut As String
strFileIn = "BasicSignByAlice.bin"
strFileOut = "BasicSignByAlice.dat"
nRet = CMS_ReadSigData(strFileOut, strFileIn, 0)
Debug.Print "CMS_ReadSigData returns " & nRet
The function should return 28 indicating the number of bytes written to the output file.
CMS_ReadSigDataToString CMS_GetSigDataDigest