|  | 
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
| (Lianja) 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. 
 llSuccess = .F. // This requires the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. loPrivKey = createobject("CkPrivateKey") loSbPem = createobject("CkStringBuilder") loSbPem.AppendLine("-----BEGIN RSA PRIVATE KEY-----",.T.) loSbPem.AppendLine("MIIC .... j5A==",.T.) loSbPem.AppendLine("-----END RSA PRIVATE KEY-----",.T.) llSuccess = loPrivKey.LoadPem(loSbPem.GetAsString()) if (llSuccess = .F.) then ? loPrivKey.LastErrorText release loPrivKey release loSbPem return endif loRsa = createobject("CkRsa") llSuccess = loRsa.UsePrivateKey(loPrivKey) if (llSuccess = .F.) then ? loRsa.LastErrorText release loPrivKey release loSbPem release loRsa return endif loBd = createobject("CkBinData") loBd.AppendString("12345678","utf-8") llSuccess = loRsa.SignRawBd(loBd) if (llSuccess = .F.) then ? loRsa.LastErrorText release loPrivKey release loSbPem release loRsa release loBd return endif // Get the base64 RSA signature. ? loBd.GetEncoded("base64") llSuccess = loRsa.VerifyRawBd(loBd) if (llSuccess = .F.) then ? loRsa.LastErrorText release loPrivKey release loSbPem release loRsa release loBd return endif lcStrOriginal = loBd.GetString("utf-8") ? lcStrOriginal release loPrivKey release loSbPem release loRsa release loBd | ||||
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.