VBScript Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript



VBScript Examples

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

More Examples...
Email Object
POP3
SMTP
Byte Array
RSS
Atom

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

 

 

 

 

 

 

 

Create Digital Signature for a File and Verify

VBScript to create a base-64 encoded digital signature for a file, and then verify it.

set crypt = CreateObject("ChilkatCrypt2.ChilkatCrypt2")
crypt.UnlockComponent "30-day trial"

crypt.EncodingMode = "Base64"

' We need a certificate for signing.
set createCs = CreateObject("ChilkatCertificate.ChilkatCreateCS")
set certStore = createCs.OpenCurrentUserStore()
set cert = certStore.FindCertBySubject("fausey@chilkatsoft.com")
MsgBox crypt.LastErrorText
crypt.SetSigningCert cert

' The following block of code is only necessary if you want to control
' the signing algorithms.
set csp = CreateObject("ChilkatUtil.ChilkatCSP")
csp.SetProviderMicrosoftEnhanced
csp.SetHashAlgorithm "MD5"
crypt.SetCSP csp

' Create the detached signature
fileData = crypt.ReadFile("signFile.vbs")
signature = crypt.SignBytesENC(fileData)
MsgBox crypt.LastErrorText
crypt.WriteFile "base64sig.txt",signature

' Verify the signature.
sigData = crypt.ReadFile("base64sig.txt")
sigOK = crypt.VerifyBytesENC(fileData,sigData)
if sigOK = 1 then
	MsgBox "signature is OK!"
else
	MsgBox crypt.LastErrorText
end if

 

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

© 2003-2007 Chilkat Software, Inc. All Rights Reserved.

Mail Component · XML Parser