Visual Basic Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CUnicode C++Unicode CMFCDelphi DLLDelphi ActiveXFoxProJavaPerlPHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

VB Examples

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

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


VB Strings
VB Byte Array

 

 

 

 

 

 

 

Create a New File-Based Certificate Store

This Visual Basic example program creates a new certificate store file and copies certificates from the Outlook registry-based cert store to the file certificate store.

' Visual Basic program to create a new file-based certificate store.
Private Sub Command1_Click()

    ' Create the Cert Store Creator
    Dim csCreator As ChilkatCreateCS
    Set csCreator = New ChilkatCreateCS
    csCreator.ReadOnly = 0
    
    'Set fs = CreateObject("Scripting.FileSystemObject")
    'fs.DeleteFile "myStore.sto"
    
    ' Create a new certificate store
    Dim cs0 As ChilkatCertStore
    Set cs0 = csCreator.CreateFileStore("c:\myStore.sto")
    
    ' Open an existing store.
    Dim cs1 As ChilkatCertStore
    Set cs1 = csCreator.OpenOutlookStore()
    
    Text1.Text = Text1.Text & "Adding certs from Outlook store..." & vbCrLf
    
    Dim cert As ChilkatCert
    For i = 0 To cs1.NumCertificates - 1
        Set cert = cs1.GetCertificate(i)
        cs0.AddCertificate cert
        Text1.Text = Text1.Text & "CN=" & cert.SubjectCN & ",E=" & cert.SubjectE & ",O=" & cert.SubjectO & vbCrLf
    Next
    Text1.Text = Text1.Text & "-------------------------" & vbCrLf
    Label1.Caption = "Status: " & Str(cs1.NumCertificates) & " loaded into new cert store"
    
    Set cs0 = Nothing
    Set cs1 = Nothing

    ' Now open the file store and read the certs.
    Text1.Text = Text1.Text & "Opening the certificate store just created..." & vbCrLf
    
    Set cs0 = csCreator.OpenFileStore("c:\myStore.sto", True)
    
    Text1.Text = Text1.Text & "Number of certificates = " & cs0.NumCertificates & vbCrLf
    
    For i = 0 To cs0.NumCertificates - 1
        Set cert = cs0.GetCertificate(i)
        Text1.Text = Text1.Text & "CN=" & cert.SubjectCN & ",E=" & cert.SubjectE & ",O=" & cert.SubjectO & vbCrLf
    Next

    csCreator.SaveXmlLog "log.xml"
    
End Sub

 

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