Visual Basic Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

VB Examples

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

More Examples...
Email Object
POP3
SMTP
RSS
Atom
Self-Extractor


VB Strings
VB Byte Array

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

 

 

 

 

 

 

 

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


 

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

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