Extracts an encrypted private key from a PKCS-12 PKCS8ShroudedKeyBag, saving the output directly as a new file.
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
long __stdcall RSA_GetPrivateKeyFromPFX(const char *szFileOut, const char *szPfxFile, long nOptions);
If successful, it returns the number of bytes written to the output file; otherwise it returns a negative error code.
Rsa.GetPrivateKeyFromPFX Method
static int dipki::Rsa::GetPrivateKeyFromPFX (const std::string &outputFile, const std::string &pfxFile)
static Rsa.get_privatekey_from_pfx(outputfile, pfxfile)
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.
nChars = RSA_GetPrivateKeyFromPFX(strEPKFile, strPfxFile, 0)
RSA_ReadEncPrivateKey RSA_ReadPrivateKeyFromPFX PFX_MakeFile