(PowerBuilder) Get Certificate Public Key from PEM
Demonstrates how to load a PEM file containing a certificate and access the public key. Note: This example requires Chilkat v11.0.0 or greater.
integer li_rc
integer li_Success
oleobject loo_Cert
oleobject loo_Pubkey
li_Success = 0
loo_Cert = create oleobject
li_rc = loo_Cert.ConnectToNewObject("Chilkat.Cert")
if li_rc < 0 then
destroy loo_Cert
MessageBox("Error","Connecting to COM object failed")
return
end if
li_Success = loo_Cert.LoadFromFile("qa_data/pem/my_cert.pem")
if li_Success = 0 then
Write-Debug loo_Cert.LastErrorText
destroy loo_Cert
return
end if
loo_Pubkey = create oleobject
li_rc = loo_Pubkey.ConnectToNewObject("Chilkat.PublicKey")
loo_Cert.GetPublicKey(loo_Pubkey)
// Examine the public key as XML..
Write-Debug loo_Pubkey.GetXml()
destroy loo_Cert
destroy loo_Pubkey
|