SecureBlackbox 2020 C++ Edition

Questions / Feedback?

ExportKeyToStream Method

Saves the private key to a stream.

Syntax

ANSI (Cross Platform)
int ExportKeyToStream(SecureBlackboxStream* sKeyStream, const char* lpszPassword, int iFormat);

Unicode (Windows)
INT ExportKeyToStream(SecureBlackboxStream* sKeyStream, LPCWSTR lpszPassword, INT iFormat);
#define MID_CERTIFICATEMANAGER_EXPORTKEYTOSTREAM 8

SECUREBLACKBOX_EXTERNAL int SECUREBLACKBOX_CALL SecureBlackbox_CertificateManager_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

Remarks

Use this method to export the private key to a stream in one of the formats given below. Pass the encryption password via the Password parameter.

Supported certificate key format values:

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.

Error Handling (C++)

This method returns a 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. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

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