SecureBlackbox Lite 2020 C++ Edition

Questions / Feedback?

ExportCert Method

Exports the certificate in the chosen format.

Syntax

ANSI (Cross Platform)
char* ExportCert(const char* lpszPassword, int iFormat, int bExportKey, int *lpSize = NULL);

Unicode (Windows)
LPSTR ExportCert(LPCWSTR lpszPassword, INT iFormat, BOOL bExportKey, LPINT lpSize = NULL);
- (NSData*)exportCert:(NSString*)password :(int)format :(BOOL)exportKey;
#define MID_CERTIFICATEMANAGER_EXPORTCERT 4

SECUREBLACKBOXLITE_EXTERNAL int SECUREBLACKBOXLITE_CALL SecureBlackboxLite_CertificateManager_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

Remarks

Use this method to save the certificate in one of the formats defined below.

ExportKey specifies whether to export the private key together with the certificate. Pass the encryption password via the Password parameter if needed.

cfmUnknown0Unknown certificate format

cfmDER1DER file format. Applicable to certificates, certificate requests, private keys. Encryption not supported

cfmPEM2PEM file format. Applicable to certificates, certificate requests, private keys. Encryption supported for private keys.

cfmPFX3PFX/PKCS#12 file format. Applicable to certificates. Encryption supported.

cfmSPC4SPC file format. Applicable to certificates. Encryption not supported.

cfmPVK5PVK file format. Applicable to private keys. Encryption not supported.

cfmPKCS86PKCS#8 file format. Applicable to private keys. Encryption supported.

cfmNET7NET file format. Applicable to private keys. Encryption not supported.

Note that not all formats support encryption, and some (like PEM) only support partial encryption (key only). Keep this in mind when considering which format to choose for storing your certificates.

Error Handling (C++)

This method returns a Byte Array value (with length lpSize); after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.

Copyright (c) 2022 /n software inc. - All rights reserved.
SecureBlackbox Lite 2020 C++ Edition - Version 20.0 [Build 8166]