B4X Requires Chilkat v11.0.0+
B4X
Get Certificate's Public Key
Loads a certificate from PEM and gets the public key.Chilkat B4X Downloads
Dim success As Boolean = False
Dim cert As ChilkatCert
cert.Initialize("cert")
Dim strPem As String = "-----BEGIN CERTIFICATE----- ..."
success = cert.LoadPem(strPem)
If success = False Then
Log(cert.LastErrorText)
Return
End If
Dim pubKey As ChilkatPublicKey
pubKey.Initialize
cert.GetPublicKey(pubKey)
' You can now use the public key object however it is needed,
' and access its various properties and methods..
Log(pubKey.GetXml)