Visual Basic Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

VB Examples

Bounced Mail
Character Encoding
Digital Certificates
Digital Signatures
Email
FTP
HTML-to-XML
HTTP
IMAP
Encryption
MHT / HTML Email
RSA Encryption
S/MIME
Socket
Spider
String
Tar
Unicode
Upload
XML
XMP
Zip Compression

More Examples...
Email Object
POP3
SMTP
RSS
Atom
Self-Extractor


VB Strings
VB Byte Array

Unreleased...
Service
PPMD
Deflate
Bzip2
LZW
Bz2
DH Key Exchange
DSA
Icon

 

 

 

 

 

 

 

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

 

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

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