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

 

 

 

 

 

 

 

Export Certificate to .cer File

Visual Basic example program showing how to export a certificate to a .cer file.

Private Sub Command1_Click()

    ' Create an object for creating CertStore objects.
    Dim ccs As New ChilkatCreateCS
    
    ' Open the Current User Certificate Store (from the registry)
    Dim certStore As ChilkatCertStore
    Set certStore = ccs.OpenCurrentUserStore()
    
    ' Find the certificate having the email address "support@chilkatsoft.com"
    Dim cert As ChilkatCert
    Set cert = certStore.FindCertBySubjectE("support@chilkatsoft.com")
    
    Dim encodedCert As String
    encodedCert = cert.GetEncoded()
    
    ' This code uses the CkData object to write to a file,
    ' but this can be replaced with any code that writes a string to a file.
    ' (The CkData object is found in the ChilkatUtil.dll)
    Dim d As New CkData
    d.AppendString "-----BEGIN CERTIFICATE-----" & vbCrLf
    d.AppendString encodedCert & vbCrLf
    d.AppendString "-----END CERTIFICATE-----" & vbCrLf
    
    d.SaveToFile "exported.cer"
    
End Sub

 

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