(Classic ASP) RSA Import Public Key
Shows how to select/import a public key for RSA encryption or signature verification.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.PublicKey")
set pubKey = Server.CreateObject("Chilkat.PublicKey")
' In all Chilkat methods expecting a path, you pass either absolute or relative paths.
success = pubKey.LoadFromFile("rsaKeys/myTestRsaPublic.pem")
If (success = 0) Then
Response.Write "<pre>" & Server.HTMLEncode( pubKey.LastErrorText) & "</pre>"
Response.End
End If
' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.Rsa")
set rsa = Server.CreateObject("Chilkat.Rsa")
' Tell RSA to use the public key.
success = rsa.ImportPublicKeyObj(pubKey)
%>
</body>
</html>
|