CryptoSys PKI Pro Manual

RSA_GetPrivateKeyFromPFX

Extracts an encrypted private key from a PKCS-12 PKCS8ShroudedKeyBag, saving the output directly as a new file.

VBA/VB6 Syntax

Public Declare Function RSA_GetPrivateKeyFromPFX Lib "diCrPKI.dll" (ByVal strOutputFile As String, ByVal strPfxFile As String, ByVal nOptions As Long) As Long

nRet = RSA_GetPrivateKeyFromPFX(strOutputFile, strPfxFile, nOptions) As Long

C/C++ Syntax

long __stdcall RSA_GetPrivateKeyFromPFX(const char *szFileOut, const char *szPfxFile, long nOptions);

Parameters

szFileOut
[in] specifying the filename of the output file to be created.
szPfxFile
[in] containing the PFX filename
nOptions
[in] option flags: not used in this release. Specify zero.

Returns (VBA/C)

If successful, it returns the number of bytes written to the output file; otherwise it returns a negative error code.

.NET Equivalent

Rsa.GetPrivateKeyFromPFX Method

C++ (STL) Equivalent

static int dipki::Rsa::GetPrivateKeyFromPFX (const std::string &outputFile, const std::string &pfxFile)

Python Equivalent

static Rsa.get_privatekey_from_pfx(outputfile, pfxfile)

Remarks

The first pkcs-12-pkcs-8ShroudedKeyBag found in the PFX file will be extracted and saved directly as a BER-encoded EncryptedPrivateKeyInfo file. No decryption or other conversion is carried out.

Example

nChars = RSA_GetPrivateKeyFromPFX(strEPKFile, strPfxFile, 0)

See Also

RSA_ReadEncPrivateKey RSA_ReadPrivateKeyFromPFX PFX_MakeFile

[Contents] [Index]

[PREV: RSA_FromXMLString...]   [Contents]   [Index]   
   [NEXT: RSA_GetPublicKeyFromCert...]

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