Mentalis.org Security Library documentation

Certificate.AssociateWithPrivateKey Method (String, String)

Associates the certificate with a private key from a PVK file.

[Visual Basic]
Overloads Public Sub AssociateWithPrivateKey( _
   ByVal pvkFile As String, _
   ByVal password As String _
)
[C#]
public void AssociateWithPrivateKey(
   string pvkFile,
   string password
);

Parameters

pvkFile
The path to the PVK file to open.
password
The password used to encrypt the private key.

Remarks

The password can be a null reference (Nothing in Visual Basic) if the private key is not encrypted.

The private key will not be exportable.

Exceptions

Exception TypeCondition
ArgumentNullExceptionThe PVK file is encrypted and password is a null reference (Nothing in Visual Basic).
FileNotFoundExceptionThe specified file could not be found.
CertificateExceptionAn error occurs while importing the private key.

See Also

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