CMS_MakeEnvDataFromString is the same as CMS_MakeEnvData
except the input data is in an ANSI string instead of a file.
Public Declare Function CMS_MakeEnvDataFromString Lib "diCrPKI.dll"
(ByVal strFileOut As String, ByVal strDataIn As String,
ByVal strCertList As String, ByVal strSeed As String, ByVal nSeedLen As Long,
ByVal nOptions As Long) As Long
nRet = CMS_MakeEnvDataFromString(strFileOut, strDataIn,
strCertList, strSeed, nSeedLen, nOptions) As Long
String with name of output file to be created.String containing input data.String containing a list of files that contain the certificates of
recipients separated by semi-colons(;)String containing a user-specified seed to be used by the random number
generator. Specify an empty string ("") to ignore.Long specifying the length of the seed string.Long option flags:
long _stdcall CMS_MakeEnvDataFromString(const char *szFileOut, const char *szDataIn,
const char *szCertList, const char *sSeed, long nSeedLen, long nOptions);
Long: If successful, the return value is the number of successful recipients;
otherwise it returns a negative error code.
Cms.MakeEnvData Method
Cms.MakeEnvData Method
See the remarks for CMS_MakeEnvData above.
The input string must only contain ANSI characters. To encrypt
binary data or Unicode characters, save as a binary data file and use CMS_MakeEnvData.
The following example reproduces example 5.2 from SMIME-EX (as far as it can, because of the different random values used each time) passing the input data as a string. The output is always a new file.
' This should return 1 (indicating one successful recipient)
nRet = CMS_MakeEnvDataFromString("C:\test\cmsalice2bob1.p7m", _
"This is some sample content.", "C:\test\BobRSASignByCarl.cer", "", 0, 0)
Debug.Print "CMS_MakeEnvDataFromString returns " & nRet
CMS_MakeEnvData CMS_ReadEnvData CMS_ReadEnvDataToString