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)
long __stdcall X509_SaveFileFromString(const char *szNewCertFile, const char *szCertString, long nOptions);
If successful, the return value is zero; otherwise it returns a negative error code.
X509.SaveFileFromString Method
static int dipki::X509::SaveFileFromString (const std::string &newCertFile, const std::string &certString, bool inPEMFormat=false)
static X509.save_file_from_string(newcertfile, certstring, in_pem_format=False)
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 message digest "thumbprint".
See the example in X509_ReadStringFromFile
.