Sample code for 30+ languages & platforms
B4X

Windows Certificate Stores - Find Certificate by Common Name

See more Certificates Examples

Searches the Windows certificate stores for a certificate that matches the specified common name (CN).

Note: This example requires Chilkat v10.0.0 or greater.

Chilkat B4X Downloads

B4X
Dim success As Boolean = False

Dim cert As ChilkatCert
cert.Initialize("cert")
success = cert.LoadByCommonName("Chilkat Software, Inc.")
If success = False Then
    Log(cert.LastErrorText)
    Return
End If


Log(cert.SubjectDN)
Log("Success.")