Chilkat Examples

ChilkatHOMEAndroid™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi DLLGoJavaNode.jsObjective-CPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwiftTclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

Classic ASP Examples

Web API Categories

ASN.1
AWS KMS
AWS Misc
Amazon EC2
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Azure Cloud Storage
Azure Key Vault
Azure Service Bus
Azure Table Service
Base64
Bounced Email
Box
CAdES
CSR
CSV
Cert Store
Certificates
Cloud Signature CSC
Code Signing
Compression
DKIM / DomainKey
DNS
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
EBICS
ECC
Ed25519
Email Object
Encryption
FTP
FileAccess
Firebase
GMail REST API
GMail SMTP/IMAP/POP
Geolocation
Google APIs
Google Calendar
Google Cloud SQL
Google Cloud Storage
Google Drive
Google Photos
Google Sheets
Google Tasks
Gzip
HTML-to-XML/Text
HTTP

HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)
Java KeyStore (JKS)
MHT / HTML Email
MIME
Microsoft Graph
Misc
NTLM
OAuth1
OAuth2
OIDC
Office365
OneDrive
OpenSSL
Outlook
Outlook Calendar
Outlook Contact
PDF Signatures
PEM
PFX/P12
PKCS11
POP3
PRNG
REST
REST Misc
RSA
SCP
SCard
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
ScMinidriver
Secrets
SharePoint
SharePoint Online
Signing in the Cloud
Socket/SSL/TLS
Spider
Stream
Tar Archive
ULID/UUID
Upload
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Zip
curl
uncategorized

 

 

 

Find Certificates that can be used for Signing

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

This ASP script shows how to iterate over the certificates on a computer to find those that can be used for signing.

<html><body>
<%

    ' What certificates exist on my computer, and which
    ' ones can I use for creating digital signatures?
    set ccs = Server.CreateObject("Chilkat_9_5_0.CreateCS")
    
    set crypt = Server.CreateObject("Chilkat_9_5_0.Crypt2")
    
    unlocked = crypt.UnlockComponent("anything begins 30-day trial")
    If unlocked = 0 Then
        ' Failed to unlock...
    End If
    
    ' Use the Microsoft Enhanced Cryptographic Service Provider
    ' Add a reference to ChilkatUtil for the ChilkatCSP object
    set csp = Server.CreateObject("Chilkat.Csp")
    csp.SetProviderMicrosoftEnhanced
    crypt.SetCSP csp
    
    ' -------------------------------------------------------
    ' Check the local machine certificate store.
    ' -------------------------------------------------------
    Set certStore = ccs.OpenLocalSystemStore()
    
    Response.write "<b>Local Machine Certificate Store</b>"
    Response.write "<table border=1>"
    
    For i = 0 To certStore.NumCertificates - 1
        Set cert = certStore.GetCertificate(i)
        
        Response.write "<tr><td>"
        
        ' Display the certificate we are testing..
        Response.write "<font size='+1'><b>" & cert.SubjectDN & "</b></font><br>"
        
        ' Set the certificate to be used for signing, and our output string encoding.
        crypt.SetSigningCert cert
        crypt.EncodingMode = "base64"
        
        ' Try signing....
        signature = crypt.SignStringENC("This is a test")
        If Len(signature) = 0 Then
            ' Failed to create signature
            Response.write "FAILED<br>"
            If cert.HasPrivateKey() = 0 Then
                Response.write "NO PRIVATE KEY<br>"
            End If
            Response.write "<p>" & crypt.LastErrorHtml
        Else
            Response.write "SUCCESS!<br>"
            Response.write "<p>" & crypt.LastErrorHtml
        End If
        
        Response.write "</td></tr>"
    Next
    
    Response.write "</table>"
    


%>

</body></html>
 

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