CryptoSys PKI Toolkit Manual

RSA_GetPrivateKeyFromPFX

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

VB6/VBA 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

Parameters

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

C/C++ Syntax

long _stdcall RSA_GetPrivateKeyFromPFX(const char *szOutputFile, const char *szPFXFile, long nOptions);

Returns (VB6/C)

Long: 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

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]

[HOME]   [NEXT: RSA_GetPublicKeyFromCert...]

Copyright © 2004-12 D.I. Management Services Pty Ltd. All rights reserved.