Sample code for 30+ languages & platforms
Classic ASP

Transition from Cert.ExportPrivateKey to Cert.GetPrivateKey

Provides instructions for replacing deprecated ExportPrivateKey method calls with GetPrivateKey.

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")

' ------------------------------------------------------------------------
' The ExportPrivateKey method is deprecated:

' privatekeyObj is a Chilkat.PrivateKey
Set privatekeyObj = cert.ExportPrivateKey()
If (cert.LastMethodSuccess = 0) Then
    Response.Write "<pre>" & Server.HTMLEncode( cert.LastErrorText) & "</pre>"
    Response.End
End If

' ...
' ...

' ------------------------------------------------------------------------
' Do the equivalent using GetPrivateKey.
' Your application creates a new, empty PrivateKey object which is passed 
' in the last argument and filled upon success.

set privatekeyOut = Server.CreateObject("Chilkat.PrivateKey")
success = cert.GetPrivateKey(privatekeyOut)
If (success = 0) Then
    Response.Write "<pre>" & Server.HTMLEncode( cert.LastErrorText) & "</pre>"
    Response.End
End If


%>
</body>
</html>