Sample code for 30+ languages & platforms
Classic ASP

Load PEM Format Certificate (.pem)

See more Certificates Examples

Loads a PEM format digital certificate and fetches information about the cert.

Chilkat Classic ASP Downloads

Classic ASP
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
success = 0

set cert = Server.CreateObject("Chilkat.Cert")

' LoadFromFile will load virtually any certificate format file.
' It will auto-recognize the format and load appropiately.

success = cert.LoadFromFile("/Users/chilkat/testData/cer/cert.pem")
If (success <> 1) Then
    Response.Write "<pre>" & Server.HTMLEncode( cert.LastErrorText) & "</pre>"
    Response.End
End If

' DN = "Distinguished Name"
Response.Write "<pre>" & Server.HTMLEncode( "SubjectDN:" & cert.SubjectDN) & "</pre>"

Response.Write "<pre>" & Server.HTMLEncode( "Common Name:" & cert.SubjectCN) & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( "Issuer Common Name:" & cert.IssuerCN) & "</pre>"

Response.Write "<pre>" & Server.HTMLEncode( "Serial Number:" & cert.SerialNumber) & "</pre>"

%>
</body>
</html>