Classic ASP
Classic ASP
Get Certificate's Public Key
Loads a certificate from PEM and gets 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")
strPem = "-----BEGIN CERTIFICATE----- ..."
success = cert.LoadPem(strPem)
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)
' You can now use the public key object however it is needed,
' and access its various properties and methods..
Response.Write "<pre>" & Server.HTMLEncode( pubKey.GetXml()) & "</pre>"
%>
</body>
</html>