CryptoSys PKI Pro Manual

X509_SaveFileFromString

Creates an X.509 certificate file from its base64 string representation.

VBA/VB6 Syntax

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)

C/C++ Syntax

long __stdcall X509_SaveFileFromString(const char *szNewCertFile, const char *szCertString, long nOptions);

Parameters

szNewCertFile
[in] with name of X.509 certificate file to be created.
szCertString
[in] containing the base64 representation of the certificate.
nOptions
[in] option flags:
PKI_X509_FORMAT_PEM to save the certificate in PEM format (default = DER-encoded binary)

Returns (VBA/C)

If successful, the return value is zero; otherwise it returns a negative error code.

.NET Equivalent

X509.SaveFileFromString Method

C++ (STL) Equivalent

static int dipki::X509::SaveFileFromString (const std::string &newCertFile, const std::string &certString, bool inPEMFormat=false)

Python Equivalent

static X509.save_file_from_string(newcertfile, certstring, in_pem_format=False)

Remarks

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".

Example

See the example in X509_ReadStringFromFile.

See Also

X509_ReadStringFromFile

[Contents] [Index]

[PREV: X509_ReadStringFromFile...]   [Contents]   [Index]   
   [NEXT: X509_TextDump...]

Copyright © 2004-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-09-23T07:52:09Z.