Sample code for 30+ languages & platforms
B4X

Get Issuer Certificate Information

See more Certificates Examples

A certificate contains information about its issuer. This example demonstrates how to get the issuer information from a certificate.

Chilkat B4X Downloads

B4X
Dim success As Boolean = False

Dim cert As ChilkatCert
cert.Initialize("cert")

success = cert.LoadFromFile("qa_data/certs/sample.cer")
If success = False Then
    Log(cert.LastErrorText)
    Return
End If


'  Get issuer information:

'  -----------------------------------------------------------------------
'  (Not all subject fields may exist depending on the issuer certificate.)
'  -----------------------------------------------------------------------

'  Issuer DN (Distinguished Name, i.e. all the Issuer subject parts)
Log("DN: " & cert.IssuerDN)

'  Common Subject parts:
'  Issuer Common Name
Log("CN: " & cert.IssuerCN)

'  Issuer Country
Log("C: " & cert.IssuerC)

'  Issuer Email address
Log("E: " & cert.IssuerE)

'  Issuer Locality
Log("L: " & cert.IssuerL)

'  Issuer Organization
Log("O: " & cert.IssuerO)

'  Issuer Organizational Unit
Log("OU: " & cert.IssuerOU)

'  Issuer State
Log("S: " & cert.IssuerS)