Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

Excel Examples

Web API Categories

ASN.1
Amazon EC2
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Azure Cloud Storage
Azure Service Bus
Azure Table Service
Base64
Bounced Email
Box
CAdES
CSR
CSV
Certificates
Compression
DKIM / DomainKey
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
MS Storage Providers
Microsoft Graph
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
SharePoint
Socket/SSL/TLS
Spider
Stream
Tar Archive
Upload
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Zip
curl

 

 

 

(Excel) Load a CSR and Get the SANs (Subject Alternative Names)

Demonstrates how to load a Certificate Signing Request (CSR) and get the Subject Alternative Names (if any).

Note: This example requires Chilkat v9.5.0.91 or greater.

Download Excel Class Modules

Chilkat Excel Class Modules

' Note: Requires Chilkat v9.5.0.91 or greater.

' This requires the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.

Dim csr As Chilkat.Csr
Set csr = Chilkat.NewCsr

' Load a CSR PEM file.  The file should contain content that looks like this:
' 
' -----BEGIN CERTIFICATE REQUEST-----
' MIIDnzCCAocCAQAwgZ4xFDASBgNVBAMMC2V4YW1wbGUuY29tMRQwEgYDVQQHDAtM
' b3MgQW5nZWxlczETMBEGA1UECAwKQ2FsaWZvcm5pYTEUMBIGA1UECgwLRXhhbXBs
' ZSBJbmMxFDASBgNVBAsMC1NTTCBTdXBwb3J0MSIwIAYJKoZIhvcNAQkBFhNleGFt
' cGxlQGV4YW1wbGUuY29tMQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEBBQAD
' ggEPADCCAQoCggEBALhIT/q7y1xwpYaR0Coplktwn7RGaJpEBCgbJWxOVPTGL540
' erlhc6MrSEr6fo/HNtAbn6MNWm5F0MwjEU7H1Jxc7DYav+ps3hyhGaK9jalE99Sm
' yFOzKMLDPyWTPpxfT4QBO4rpWxMT2lgixDkZlaNqmC6pUGXArfH+H1F3C0gtH4ZU
' XN/Ipyk6r6ozWnJvIefdMe1JmeMD3RSoVcXd9bNWSpiD4uJnV+2pewkkNzhcGzBH
' MGi4ZjIbpPiYLlri/79fPb6u7wYkYLzCWRKzq6EaJkqY6OQgE33SC1GQKjC/fFRx
' wogub1s9cRjfL6vdqWbTJ5xhOkPeBO3UzHBHIksCAwEAAaCBujCBtwYJKoZIhvcN
' AQkOMYGpMIGmMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgWgMB0GA1UdJQQWMBQGCCsG
' AQUFBwMBBggrBgEFBQcDAjBtBgNVHREEZjBkggtleGFtcGxlLmNvbYIPd3d3LmV4
' YW1wbGUuY29tgg9mdHAuZXhhbXBsZS5jb22CD3N2bi5leGFtcGxlLmNvbYIQc210
' cC5leGFtcGxlLmNvbYIQaW1hcC5leGFtcGxlLmNvbTANBgkqhkiG9w0BAQsFAAOC
' AQEAsIEDMlZViEVtuQWpfa6vUl5RfqQrop+hh9l4UmEOnERLEzyVO+9Kn7jNxyOR
' Gg7O9H4BYTfet6YwfpawbnQ1HBexduRZaUnET8RiYgKch0vWr/HbP7jvc23XUz2P
' NOAiet/tyTU6U5xJn0H4q1VFIbHjntpBSL+n+aiv8glIUepG8BwTu+vBe2/kVzKG
' ro2tudhbpEJYOwurlHCoubhCah9ryIkDeYEnycsrB6VnaxeGK0/5S2JBQo22/F9s
' T+q0Gee936ISvypLwNoIX+YFAjw2KnqucUM3RKHAAheJin5WNIQXdHHKGsImapun
' VqmPwLN6Kgm+kFVS0H5eyULSnA==
' -----END CERTIFICATE REQUEST-----

Dim fac As Chilkat.FileAccess
Set fac = Chilkat.NewFileAccess

csrPem = fac.ReadEntireTextFile("qa_data/csr/myCsr.pem","utf-8")


success = csr.LoadCsrPem(csrPem)
If (success <> True) Then
    Debug.Print csr.LastErrorText
    Exit Sub
End If

' Get the SANs
Dim st As Chilkat.StringTable
Set st = Chilkat.NewStringTable

success = csr.GetSans(st)
If (success <> True) Then
    Debug.Print csr.LastErrorText
    Exit Sub
End If


i = 0

numSans = st.Count
Do While i < numSans
    Debug.Print st.StringAt(i)
    i = i + 1
Loop

 

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