Classic ASP
Classic ASP
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 Classic ASP Downloads
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
success = 0
set cert = Server.CreateObject("Chilkat.Cert")
success = cert.LoadFromFile("qa_data/pem/my_cert.pem")
If (success = 0) Then
Response.Write "<pre>" & Server.HTMLEncode( cert.LastErrorText) & "</pre>"
Response.End
End If
set pubkey = Server.CreateObject("Chilkat.PublicKey")
success = cert.GetPublicKey(pubkey)
' Examine the public key as XML..
Response.Write "<pre>" & Server.HTMLEncode( pubkey.GetXml()) & "</pre>"
%>
</body>
</html>