Converts the contents of a PEM file into a binary file.
Public Declare Function PEM_FileToBinFile Lib "diCrPKI.dll"
(ByVal strOutputFile As String, ByVal strFileIn As String) As Long
nRet = PEM_FileToBinFile(strOutputFile, strFileIn)
long __stdcall PEM_FileToBinFile(const char *szFileOut, const char *szFileIn);
If successful, the return value is zero; otherwise it returns a nonzero error code.
static int dipki::Pem::FileToBinFile (const std::string &fileToMake, const std::string &fileIn)
static Pem.to_binfile(outputfile, filein)
Any base64-encoded data found between a PEM header and footer is converted into binary data and saved as a file.
-----BEGIN FOO BAR----- MIAGCSqGSIb3DQEHA... -----END FOO BAR-----
Dim nRet As Long Dim strBinFile As String Dim strPemFile As String Dim strDigest As String ' Input file is a PEM-encoded X.509 certificate strPemFile = "smallca.pem.cer" strBinFile = "smallca-copy.cer" ' Convert to a binary file nRet = PEM_FileToBinFile(strBinFile, strPemFile) Debug.Print "PEM_FiletoBinFile returns " & nRet & " (expecting 0)"