Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
Create S/MIME Detached Digital SignatureThis VB example program shows how to create a detached digital signature. An input file is loaded into a MIME message as an attachment, and then the MIME message is signed to create an x-pkcs7-signature message with a detached signature. ' Converts any kind of file into an S/MIME message with
' a detached (clear-text) 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 message with a detached signature.
mime.AddDetachedSignature cert
mime.SaveMime "signed.txt"
' In addition, any MIME message can converted and saved as XML:
mime.SaveXml "signed.xml"
End Sub
|
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.