Saves the Certificate as a PFX encoded file.

Namespace: LLCryptoLib.Security.Certificates
Assembly: LLCryptoLib (in LLCryptoLib.dll) Version: 2.0.1024.0 (2.0.1024)

Syntax

C#
public void ToPfxFile(
	string filename,
	string password,
	bool withPrivateKeys,
	bool withParents
)
Visual Basic
Public Sub ToPfxFile ( _
	filename As String, _
	password As String, _
	withPrivateKeys As Boolean, _
	withParents As Boolean _
)
Visual C++
public:
void ToPfxFile(
	String^ filename, 
	String^ password, 
	bool withPrivateKeys, 
	bool withParents
)

Parameters

filename
Type: System..::..String
The filename of the new PFX file.
password
Type: System..::..String
The password to use when encrypting the private keys.
withPrivateKeys
Type: System..::..Boolean
true if the private keys should be exported [if possible], false otherwise.
withParents
Type: System..::..Boolean
true if the parent certificates should be exported too [if possible], false otherwise.

Remarks

If the specified file already exists, the method will throw an exception.

Exceptions

ExceptionCondition
System..::..ArgumentNullExceptionfilename or password is a null reference (Nothing in Visual Basic).
System.IO..::..IOExceptionAn error occurs while writing the data to the file.
LLCryptoLib.Security.Certificates..::..CertificateExceptionAn error occurs while exporting the certificate store
-or-

an error occurs while building the certificate chain

-or-

an error occurs while creating the store

-or-

an error occurs while adding the certificate to the store.

See Also