![]() |
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
(SQL Server) Base64url EncodingBase64url encoding is identical to base64 encoding except it uses non-reserved URL characters (e.g. '–' is used instead of '+', and '_' is used instead of '/') and it omits the padding characters. Note: This example requires Chilkat v11.0.0 or greater.
-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls. -- CREATE PROCEDURE ChilkatSample AS BEGIN DECLARE @hr int DECLARE @success int SELECT @success = 0 -- This example requires the Chilkat API to have been previously unlocked. -- See Global Unlock Sample for sample code. DECLARE @pkey int EXEC @hr = sp_OACreate 'Chilkat.PrivateKey', @pkey OUT IF @hr <> 0 BEGIN PRINT 'Failed to create ActiveX component' RETURN END DECLARE @rsa int EXEC @hr = sp_OACreate 'Chilkat.Rsa', @rsa OUT EXEC sp_OAMethod @rsa, 'GenKey', @success OUT, 1024, @pkey EXEC sp_OAMethod @rsa, 'UsePrivateKey', @success OUT, @pkey DECLARE @strData nvarchar(4000) SELECT @strData = 'This is the string to be signed.' -- Get the signature in base64url EXEC sp_OASetProperty @rsa, 'EncodingMode', 'base64url' DECLARE @strSig nvarchar(4000) EXEC sp_OAMethod @rsa, 'SignStringENC', @strSig OUT, @strData, 'sha256' PRINT @strSig EXEC @hr = sp_OADestroy @pkey EXEC @hr = sp_OADestroy @rsa END GO |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.