![]() |
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) Example: Crypt2.GetSignatureSigningTimeStr methodDemonstrates how to call the GetSignatureSigningTimeStr method.
-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls. -- CREATE PROCEDURE ChilkatSample AS BEGIN DECLARE @hr int DECLARE @iTmp0 int -- Important: Do not use nvarchar(max). See the warning about using nvarchar(max). DECLARE @sTmp0 nvarchar(4000) DECLARE @crypt int EXEC @hr = sp_OACreate 'Chilkat.Crypt2', @crypt OUT IF @hr <> 0 BEGIN PRINT 'Failed to create ActiveX component' RETURN END DECLARE @success int EXEC sp_OAMethod @crypt, 'VerifyP7M', @success OUT, 'qa_data/cades/CAdES-T/Signature-C-T-1.p7m', 'qa_output/out.dat' IF @success = 0 BEGIN EXEC sp_OAGetProperty @crypt, 'LastErrorText', @sTmp0 OUT PRINT @sTmp0 EXEC @hr = sp_OADestroy @crypt RETURN END DECLARE @numSigners int EXEC sp_OAGetProperty @crypt, 'NumSignerCerts', @numSigners OUT PRINT 'Num Signers = ' + @numSigners DECLARE @i int SELECT @i = 0 WHILE @i < @numSigners BEGIN EXEC sp_OAMethod @crypt, 'HasSignatureSigningTime', @iTmp0 OUT, @i IF @iTmp0 = 1 BEGIN EXEC sp_OAMethod @crypt, 'GetSignatureSigningTimeStr', @sTmp0 OUT, @i PRINT @i + 1 + ': ' + @sTmp0 END ELSE BEGIN PRINT @i + 1 + ': has no signing time.' END SELECT @i = @i + 1 END -- Sample output: -- Num Signers = 1 -- 1: Sun, 03 Dec 2013 06:57:41 GMT EXEC @hr = sp_OADestroy @crypt END GO |
||||
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.