Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
|
Import a PFX This example demonstrates how to import a PFX file onto the local system. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim pfx As New Chilkat.Pfx()
' Any string passed to UnlockComponent begins the 30-day trial.
Dim unlocked As Boolean
unlocked = pfx.UnlockComponent("30-day trial")
If Not unlocked Then
MsgBox("Component is not unlocked")
Exit Sub
End If
' The private keys are stored under local computer and not the current user.
Dim useMachineKeyset As Boolean
useMachineKeyset = True
' The certificate(s) are placed in the local machine store.
Dim useLocalMachineCertStore As Boolean
useLocalMachineCertStore = True
'Imported keys are marked as exportable.
Dim markAsExportable As Boolean
markAsExportable = True
' The user is to be notified through a dialog box or
' other method when certain actions are attempting to use this key. The precise
' behavior is specified by the cryptographic service provider (CSP) being used.
Dim wantWarningDialog As Boolean
wantWarningDialog = False
Dim success As Boolean
success = pfx.ImportPfxFile("myPfx.pfx", "myPassword", useMachineKeyset, useLocalMachineCertStore, markAsExportable, wantWarningDialog)
If Not success Then
MsgBox(pfx.LastErrorText)
Else
MsgBox("Imported PFX!")
End If
End Sub
Important: The download for this
example does not contain the ChilkatDotNet.dll which |
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2007 Chilkat Software, Inc. All Rights Reserved.