Mentalis.org Security Library documentation

CertificateStore.CreateFromPfxFile Method (String, String, Boolean)

Creates a new certificate store from a PFX/P12 encoded file.

[Visual Basic]
Overloads Public Shared Function CreateFromPfxFile( _
   ByVal file As String, _
   ByVal password As String, _
   ByVal exportable As Boolean _
) As CertificateStore
[C#]
public static CertificateStore CreateFromPfxFile(
   string file,
   string password,
   bool exportable
);

Parameters

file
The full path to the PFX file.
password
The password used to encrypt the private key.
exportable
true if the private keys associated with the certificates should be marked as exportable, false otherwise.

Return Value

A CertificateStore instance.

Remarks

Thanks go out to Chris Hudel for the implementation of this method.

Exceptions

Exception TypeCondition
ArgumentNullExceptionfile or password is a null reference (Nothing in Visual Basic).
IOExceptionAn error occurs whil reading from the specified file.
CertificateExceptionAn error occurs while loading the PFX file.

See Also

CertificateStore Class | Org.Mentalis.Security.Certificates Namespace | CertificateStore.CreateFromPfxFile Overload List