Mentalis.org Security Library documentation

Certificate.CreateFromPfxFile Method (String, String)

Creates a new instance of the Certificate class by opening a PFX file and retrieving the first certificate from it.

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

Parameters

file
The full path to the PFX file.
password
The password used to encrypt the private key.

Return Value

One of the certificates in the PFX file.

Exceptions

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

See Also

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