This C# example, which must be run from an ASP.NET process, imports the certificate(s) from a PFX file and installs them in the process’s Current User certificate store. (The ASP.NET process is most likely running under the ASPNET account.)
<font face=courier size=2>
Chilkat.Pfx pfx = new Chilkat.Pfx();
pfx.UnlockComponent("30-day trial");
bool bMachineKeySet = false;
bool bLocalMachineCertStore = false;
bool bExportable = true;
bool bWarningDialog = false; // low security to prevent the warning dialog
bool success = pfx.ImportPfxFile(Server.MapPath("myCertWithPrivateKey.pfx"),"pfxPassword",
bMachineKeySet,bLocalMachineCertStore,bExportable,bWarningDialog);
if (success)
{
TextBox1.Text = "Success!";
}
else
{
TextBox1.Text = "Failed!";
}
</font>