Ruby
Ruby
Get Certificate Public Key from PEM
See more Certificates Examples
Demonstrates how to load a PEM file containing a certificate and access the public key.Chilkat Ruby Downloads
require 'chilkat'
success = false
cert = Chilkat::CkCert.new()
success = cert.LoadFromFile("qa_data/pem/my_cert.pem")
if (success == false)
print cert.lastErrorText() + "\n";
exit
end
pubkey = Chilkat::CkPublicKey.new()
cert.GetPublicKey(pubkey)
# Examine the public key as XML..
print pubkey.getXml() + "\n";