![]()  | 
  
Chilkat  HOME  Android™  AutoIt  C  C#  C++  Chilkat2-Python  CkPython  Classic ASP  DataFlex  Delphi DLL  Go  Java  Node.js  Objective-C  PHP Extension  Perl  PowerBuilder  PowerShell  PureBasic  Ruby  SQL Server  Swift  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. Note: This example requires Chilkat v11.0.0 or greater. 
 Use ChilkatAx-win32.pkg Procedure Test Boolean iSuccess Variant vBd Handle hoBd Handle hoPrivKey Variant vPubKey Handle hoPubKey String sPubKeyBase64 String sTemp1 Move False To iSuccess // 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 Create (RefClass(cComChilkatPublicKey)) To hoPubKey If (Not(IsComObjectCreated(hoPubKey))) Begin Send CreateComObject of hoPubKey End Get pvComObject of hoPubKey to vPubKey Get ComToPublicKey Of hoPrivKey vPubKey To iSuccess Get ComGetEncoded Of hoPubKey True "base64" To sPubKeyBase64 Showln sPubKeyBase64 End_Procedure  | 
  ||||
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.