X509_SaveFileFromString creates an X.509 certificate file from its base64 string representation.
Public Declare Function X509_SaveFileFromString Lib "diCrPKI.dll"
(ByVal strNewCertFile As String, ByVal strCertString As String, ByVal nOptions As Long) As Long
nRet = X509_SaveFileFromString(strNewCertFile, strCertString, nOptions) As Long
String with name of X.509 certificate file to be created.String containing the base64 representation of the certificate.Long option flags:
long _stdcall X509_SaveFileFromString(const char *szNewCertFile, const char *szCertString, long nOptions);
Long: If successful, the return value is zero;
otherwise it returns a negative error code.
X509.SaveFileFromString Method
This function creates a new X.509 certificate file from a base64 string.
It is the reverse of X509_ReadStringFromFile.
Any existing file of the same name will be overwritten without warning.
The default option (nOptions = 0) is to save the file in binary (BER, DER) format.
A PEM format file will start with -----BEGIN CERTIFICATE----- and will contain the same
base64 characters as in the certificate string.
Both formats should be equally readable with the usual certificate manager programs
and both should have the same mesage digest "thumbprint".
See the example in X509_ReadStringFromFile.