![]() |
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
(AutoIt) 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. Note: This example requires Chilkat v11.0.0 or greater.
Local $bSuccess = False ; This requires the Chilkat API to have been previously unlocked. ; See Global Unlock Sample for sample code. $oPrivKey = ObjCreate("Chilkat.PrivateKey") $oSbPem = ObjCreate("Chilkat.StringBuilder") $oSbPem.AppendLine("-----BEGIN RSA PRIVATE KEY-----",True) $oSbPem.AppendLine("MIIC .... j5A==",True) $oSbPem.AppendLine("-----END RSA PRIVATE KEY-----",True) $bSuccess = $oPrivKey.LoadPem($oSbPem.GetAsString()) If ($bSuccess = False) Then ConsoleWrite($oPrivKey.LastErrorText & @CRLF) Exit EndIf $oRsa = ObjCreate("Chilkat.Rsa") $bSuccess = $oRsa.UsePrivateKey($oPrivKey) If ($bSuccess = False) Then ConsoleWrite($oRsa.LastErrorText & @CRLF) Exit EndIf $oBd = ObjCreate("Chilkat.BinData") $oBd.AppendString("12345678","utf-8") $bSuccess = $oRsa.SignRawBd($oBd) If ($bSuccess = False) Then ConsoleWrite($oRsa.LastErrorText & @CRLF) Exit EndIf ; Get the base64 RSA signature. ConsoleWrite($oBd.GetEncoded("base64") & @CRLF) $bSuccess = $oRsa.VerifyRawBd($oBd) If ($bSuccess = False) Then ConsoleWrite($oRsa.LastErrorText & @CRLF) Exit EndIf Local $strOriginal = $oBd.GetString("utf-8") ConsoleWrite($strOriginal & @CRLF) |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.