VBScript Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

VBScript Examples

Bounced Mail
Bz2
Character Encoding
Digital Certificates
CSV
Digital Signatures
Email
FTP
HTML Conversion
HTTP
IMAP
Encryption
MHT / HTML Email
POP3
PFX
RSA
S/MIME
SFTP
SMTP
Socket
Spider
SSH
SSH Key
SSH Tunnel
String
Tar
Upload
XML
XMP
Zip Compression
Self-Extractor

More Examples...
Amazon S3
Email Object
DKIM / DomainKey
NTLM
FileAccess
Byte Array
RSS
Atom
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

 

 

 

 

 

 

 

Create Digital Signature for a File and Verify

Download Chilkat Crypt ActiveX

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

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

crypt.EncodingMode = "Base64"

' We need a certificate for signing.
set createCs = CreateObject("Chilkat.CreateCS")
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("Chilkat.Csp")
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

 

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

Mail Component · XML Parser