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 / Verify Detached Digital Signature

Download Chilkat Crypt ActiveX

Visual Basic example to create a detached digital signature, and also to verify text data against a detached digital signature.

Private Sub CreateSignature_Click()

    ' Load a certificate from a file.
    ' The private key associated with the certificate must be installed
    ' on the computer to create a digital signature.
    ' You will need to modify this example to use your own digital certificate.
    Dim cert As New ChilkatCert
    cert.LoadFromFile "matt.cer"
    
    Dim crypt As New ChilkatCrypt2
    
    ' Anything begins the 30-day trial
    crypt.UnlockComponent "30-day trial"
    
    crypt.SetSigningCert cert
    
    ' Create a detached digital signature, and encode the binary data
    ' into Base64 for display in a text box.
    crypt.EncodingMode = "Base64"
    Text2.Text = crypt.SignStringENC(Text1.Text)
        
End Sub

Private Sub VerifySignature_Click()

    ' To verify the digital signature, only the public-key is required.
    Dim crypt As New ChilkatCrypt2
    
    ' Anything begins the 30-day trial
    crypt.UnlockComponent "30-day trial"
    
    ' Tell the encryption component that the signature is base-64 encoded.
    crypt.EncodingMode = "Base64"
    
    ' Returns 1 for success, 0 for failure.
    valid = crypt.VerifyStringENC(Text1.Text, Text2.Text)
    If (valid = 0) Then
        MsgBox crypt.LastErrorText
    Else
        MsgBox "Signature is valid!"
    End If

End Sub


 

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