Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Classic ASP) Get Base64 Public Key from Private KeyDemonstrates how to get the public key in base64 format from a private key.
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <% ' Load a private key from base64. ' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.BinData") set bd = Server.CreateObject("Chilkat.BinData") success = bd.AppendEncoded("MHQCA....n0Q==","base64") ' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.PrivateKey") set privKey = Server.CreateObject("Chilkat.PrivateKey") success = privKey.LoadAnyFormat(bd,"") If (success = 0) Then Response.Write "<pre>" & Server.HTMLEncode( privKey.LastErrorText) & "</pre>" Response.End End If ' pubKey is a Chilkat.PublicKey Set pubKey = privKey.GetPublicKey() If (privKey.LastMethodSuccess = 0) Then Response.Write "<pre>" & Server.HTMLEncode( privKey.LastErrorText) & "</pre>" Response.End End If pubKeyBase64 = pubKey.GetEncoded(1,"base64") Response.Write "<pre>" & Server.HTMLEncode( pubKeyBase64) & "</pre>" %> </body> </html> |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.