Mentalis.org Security Library documentation

CertificateStore.CreateFromPfxFile Method (Byte[], String, Boolean)

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

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

Parameters

file
The contents of a 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).
CertificateExceptionAn error occurs while loading the PFX file.

See Also

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