Mentalis.org Security Library documentation

Certificate.CreateFromPfxFile Method (Byte[], 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 Byte(), _
   ByVal password As String _
) As Certificate
[C#]
public static Certificate CreateFromPfxFile(
   byte[] file,
   string password
);

Parameters

file
The contents of a 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 bytes.

See Also

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