Mentalis.org Security Library documentation

CertificateStore.ToPfxBuffer Method 

Saves the CertificateStore as a PFX encoded file.

[Visual Basic]
Public Function ToPfxBuffer( _
   ByVal password As String, _
   ByVal exportPrivateKeys As Boolean _
) As Byte()
[C#]
public byte[] ToPfxBuffer(
   string password,
   bool exportPrivateKeys
);

Parameters

password
The password to use when encrypting the private keys.
exportPrivateKeys
true if the private keys should be exported [if possible], false otherwise.

Return Value

An array of bytes that represents the PFX encoded store.

Exceptions

Exception TypeCondition
ArgumentNullExceptionpassword is a null reference (Nothing in Visual Basic).
CertificateExceptionAn error occurs while exporting the certificate store.

See Also

CertificateStore Class | CertificateStore Members | Org.Mentalis.Security.Certificates Namespace