VB.NET Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript



VB.NET Examples

Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
FTP
HTML to XML
HTTP
IMAP
Encryption
MHT / HTML Email
POP3
PFX
RSA
S/MIME
SMTP
Socket
Spider
SSH
SSH Tunnel
SSH Key
SFTP
Tar Archive
Upload
XML
XMP
Zip Compression
Misc

More Examples...
Email Object
DKIM / DomainKey
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

Byte Array
VB.NET FTPS
System.IO

 

 

 

 

 

 

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
must be downloaded and installed separately at http://www.chilkatsoft.com/downloads.asp.
Once installed, add a reference to the DLL in the project by following the instructions at
http://www.example-code.com/vbdotnet/step2.asp

 

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2009 Chilkat Software, Inc. All Rights Reserved.

Mail Component · XML Parser