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

Namespace: LLCryptoLib.Security.Certificates
Assembly: LLCryptoLib (in LLCryptoLib.dll) Version: 2.0.1024.0 (2.0.1024)

Syntax

C#
public static CertificateStore CreateFromPfxFile(
	byte[] file,
	string password,
	bool exportable,
	KeysetLocation location
)
Visual Basic
Public Shared Function CreateFromPfxFile ( _
	file As Byte(), _
	password As String, _
	exportable As Boolean, _
	location As KeysetLocation _
) As CertificateStore
Visual C++
public:
static CertificateStore^ CreateFromPfxFile(
	array<unsigned char>^ file, 
	String^ password, 
	bool exportable, 
	KeysetLocation location
)

Parameters

file
Type: array<System..::..Byte>[]()[][]
The contents of a PFX file.
password
Type: System..::..String
The password used to encrypt the private key.
exportable
Type: System..::..Boolean
true if the private keys associated with the certificates should be marked as exportable, false otherwise.
location
Type: LLCryptoLib.Security.Certificates..::..KeysetLocation
One of the KeysetLocation values.

Return Value

A CertificateStore instance.

Exceptions

ExceptionCondition
System..::..ArgumentNullExceptionfile or password is a null reference (Nothing in Visual Basic).
System..::..ArgumentExceptionpassword is invalid.
LLCryptoLib.Security.Certificates..::..CertificateExceptionAn error occurs while loading the PFX file.

See Also