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) RSA Sign using Base64 Private KeySigns a string using a non-encrypted RSA private key in base64 encoding. Returns the RSA signature as a base64 string.
Use ChilkatAx-win32.pkg Procedure Test Variant vPrivKey Handle hoPrivKey Boolean iSuccess Handle hoSbPem Handle hoRsa String sStrSigned String sStrOriginal String sTemp1 // This requires the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. Get Create (RefClass(cComChilkatPrivateKey)) To hoPrivKey If (Not(IsComObjectCreated(hoPrivKey))) Begin Send CreateComObject of hoPrivKey End Get Create (RefClass(cComChilkatStringBuilder)) To hoSbPem If (Not(IsComObjectCreated(hoSbPem))) Begin Send CreateComObject of hoSbPem End Get ComAppendLine Of hoSbPem "-----BEGIN RSA PRIVATE KEY-----" True To iSuccess Get ComAppendLine Of hoSbPem "MIIC .... j5A==" True To iSuccess Get ComAppendLine Of hoSbPem "-----END RSA PRIVATE KEY-----" True To iSuccess Get ComGetAsString Of hoSbPem To sTemp1 Get ComLoadPem Of hoPrivKey sTemp1 To iSuccess If (iSuccess <> True) Begin Get ComLastErrorText Of hoPrivKey To sTemp1 Showln sTemp1 Procedure_Return End Get Create (RefClass(cComChilkatRsa)) To hoRsa If (Not(IsComObjectCreated(hoRsa))) Begin Send CreateComObject of hoRsa End Get pvComObject of hoPrivKey to vPrivKey Get ComImportPrivateKeyObj Of hoRsa vPrivKey To iSuccess If (iSuccess <> True) Begin Get ComLastErrorText Of hoRsa To sTemp1 Showln sTemp1 Procedure_Return End Set ComEncodingMode Of hoRsa To "base64" Get ComOpenSslSignStringENC Of hoRsa "12345678" To sStrSigned Showln sStrSigned Get ComOpenSslVerifyStringENC Of hoRsa sStrSigned To sStrOriginal Showln sStrOriginal End_Procedure |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.