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) RSASSA-PSS Algorithm with SHA256 HashingRSA encrypt a SHA256 hash with OAEP padding.
Use ChilkatAx-win32.pkg Procedure Test Variant vPrivkey Handle hoPrivkey Boolean iSuccess Handle hoRsa String sSigStr String sTemp1 Boolean bTemp1 // This example 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 // Load the private key object from a PEM file. // (To load from a PEM string, call LoadPem instead.) Get ComLoadPemFile Of hoPrivkey "somePath/myPrivateKey.pem" 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 // Use RSA-PSS by setting OaepPadding = True Set ComOaepPadding Of hoRsa To True // Use SHA256 Set ComOaepHash Of hoRsa To "SHA-256" Get pvComObject of hoPrivkey to vPrivkey Get ComImportPrivateKeyObj Of hoRsa vPrivkey To iSuccess // Generate a base64 signature. Set ComEncodingMode Of hoRsa To "base64" Get ComSignStringENC Of hoRsa "String to be signed" "SHA-256" To sSigStr Get ComLastMethodSuccess Of hoRsa To bTemp1 If (bTemp1 <> True) Begin Get ComLastErrorText Of hoRsa To sTemp1 Showln sTemp1 Procedure_Return End Showln "Signature: " sSigStr End_Procedure |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.