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

 

 

 

 

 

 

 

Create S/MIME Signed-Data Message

Download Chilkat MIME ActiveX

This Visual Basic sample program shows how to create an S/MIME signed-data message. A file is loaded into a MIME message as an attachment, a digital certificate is located and then used to create an x-pkcs7-mime signed-data message.

' Converts any kind of file into an S/MIME message with
' an attached (opaque) digital signature.
Private Sub Command1_Click()

        Dim mime As New ChilkatMime

   
        mime.UnlockComponent "Anything for 30-day trial"
        mime.SetBodyFromPlainText "This is a message containing a GIF image file."
        mime.AppendPartFromFile "dude.gif"
        mime.SaveMime "unsigned.txt"

        ' Locate a certificate in the Current User Store (in the registry)
        ' There are many different ways of locating and using certificates
        ' using Cert, CertStore and CreateCS.
        Dim ccs As New ChilkatCreateCS
        Dim certStore As ChilkatCertStore
        Dim cert As ChilkatCert

        Set certStore = ccs.OpenCurrentUserStore()
        Set cert = certStore.FindCertForEmail("matt@chilkatsoft.com")

        ' Use the certificate for signing.
        ' This creates a signed message.
        mime.ConvertToSigned cert
        mime.SaveMime "signed.txt"

        ' You can always convert MIME to XML
        ' XML is easier to parse, and you can always convert back from XML to MIME.
        mime.SaveXml "signed.xml"

End Sub



 

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