Visual Basic Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP 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

 

 

 

 

 

 

 

List Digital Certificates in Current-User Certificate Store

This Visual Basic example shows how to list the digital certificates in the current-user certificate store.

' VB program to display digital certificates in the
' current-user certificate store in the Windows registry.
Private Sub Command1_Click()
    
    ' Create our certificate store factory object.
    Dim StoreCreator As ChilkatCreateCS
    Set StoreCreator = New ChilkatCreateCS
    
    ' Create a certificate store object representing the registry-based
    ' current user certificate store.
    Dim certStore As ChilkatCertStore
    Set certStore = StoreCreator.OpenCurrentUserStore()
    
    ' Get the number of certificates in the store.
    numCerts = certStore.NumCertificates
    
    Text1.Text = "Number of certificates in Current User Store: " & Str(numCerts) & vbCrLf
    
    Dim cert As ChilkatCert
    Index = 0
    
    ' Loop over the certificates, get each certificate and print information about each.
    For Index = 0 To numCerts - 1
        Set cert = certStore.GetCertificate(Index)
        
        Text1.Text = Text1.Text & "----------------------------" & vbCrLf
        Text1.Text = Text1.Text & "Serial Number:" & cert.SerialNumber & vbCrLf
        Text1.Text = Text1.Text & "Valid From: " & cert.ValidFrom & vbCrLf
        Text1.Text = Text1.Text & "Valid To: " & cert.ValidTo & vbCrLf
        Text1.Text = Text1.Text & "Subject:" & vbCrLf
        Text1.Text = Text1.Text & "    Common Name: " & cert.SubjectCN & vbCrLf
        Text1.Text = Text1.Text & "    Email: " & cert.SubjectE & vbCrLf
        Text1.Text = Text1.Text & "    Organizational Unit: " & cert.SubjectOU & vbCrLf
        Text1.Text = Text1.Text & "    Organization: " & cert.SubjectO & vbCrLf
        Text1.Text = Text1.Text & "    Locality: " & cert.SubjectL & vbCrLf
        Text1.Text = Text1.Text & "    State: " & cert.SubjectS & vbCrLf
        Text1.Text = Text1.Text & "    Country: " & cert.SubjectC & vbCrLf
        Text1.Text = Text1.Text & "Issuer:" & vbCrLf
        Text1.Text = Text1.Text & "    Common Name: " & cert.IssuerCN & vbCrLf
        Text1.Text = Text1.Text & "    Email: " & cert.IssuerE & vbCrLf
        Text1.Text = Text1.Text & "    Organizational Unit: " & cert.IssuerOU & vbCrLf
        Text1.Text = Text1.Text & "    Organization: " & cert.IssuerO & vbCrLf
        Text1.Text = Text1.Text & "    Locality: " & cert.IssuerL & vbCrLf
        Text1.Text = Text1.Text & "    State: " & cert.IssuerS & vbCrLf
        Text1.Text = Text1.Text & "    Country: " & cert.IssuerC & vbCrLf
        
    Next
    
    Set certStore = Nothing
    
End Sub

 

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