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
(DataFlex) Get Base64 Public Key from Private KeyDemonstrates how to get the public key in base64 format from a private key.
Use ChilkatAx-win32.pkg Procedure Test Variant vBd Handle hoBd Boolean iSuccess Handle hoPrivKey Variant vPubKey Handle hoPubKey String sPubKeyBase64 String sTemp1 Boolean bTemp1 // Load a private key from base64. Get Create (RefClass(cComChilkatBinData)) To hoBd If (Not(IsComObjectCreated(hoBd))) Begin Send CreateComObject of hoBd End Get ComAppendEncoded Of hoBd "MHQCA....n0Q==" "base64" To iSuccess Get Create (RefClass(cComChilkatPrivateKey)) To hoPrivKey If (Not(IsComObjectCreated(hoPrivKey))) Begin Send CreateComObject of hoPrivKey End Get pvComObject of hoBd to vBd Get ComLoadAnyFormat Of hoPrivKey vBd "" To iSuccess If (iSuccess = False) Begin Get ComLastErrorText Of hoPrivKey To sTemp1 Showln sTemp1 Procedure_Return End Get ComGetPublicKey Of hoPrivKey To vPubKey If (IsComObject(vPubKey)) Begin Get Create (RefClass(cComChilkatPublicKey)) To hoPubKey Set pvComObject Of hoPubKey To vPubKey End Get ComLastMethodSuccess Of hoPrivKey To bTemp1 If (bTemp1 = False) Begin Get ComLastErrorText Of hoPrivKey To sTemp1 Showln sTemp1 Procedure_Return End Get ComGetEncoded Of hoPubKey True "base64" To sPubKeyBase64 Showln sPubKeyBase64 Send Destroy of hoPubKey End_Procedure |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.