![]() |
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
(PowerBuilder) Generate RSA Public/Private KeyPowerBuilder example code showing how to generate an RSA public/private key.
integer li_rc oleobject loo_Rsa integer li_Success string ls_PublicKey string ls_PrivateKey // This example assumes the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. loo_Rsa = create oleobject // Use "Chilkat_9_5_0.Rsa" for versions of Chilkat < 10.0.0 li_rc = loo_Rsa.ConnectToNewObject("Chilkat.Rsa") if li_rc < 0 then destroy loo_Rsa MessageBox("Error","Connecting to COM object failed") return end if // Generate a 1024-bit key. Chilkat RSA supports // key sizes ranging from 512 bits to 4096 bits. // Note: Starting in Chilkat v9.5.0.49, RSA key sizes can be up to 8192 bits. // It takes a considerable amount of time and processing power to generate // an 8192-bit key. li_Success = loo_Rsa.GenerateKey(1024) if li_Success <> 1 then Write-Debug loo_Rsa.LastErrorText destroy loo_Rsa return end if // Keys are exported in XML format: ls_PublicKey = loo_Rsa.ExportPublicKey() Write-Debug ls_PublicKey ls_PrivateKey = loo_Rsa.ExportPrivateKey() Write-Debug ls_PrivateKey destroy loo_Rsa |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.