![]() |
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.LastSignerCert methodDemonstrates how to call the LastSignerCert method. 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 -- 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 @p7m_path nvarchar(4000) SELECT @p7m_path = 'qa_data/p7m/Firma.docx.p7m' DECLARE @out_path nvarchar(4000) SELECT @out_path = 'qa_output/Firma.docx' DECLARE @success int EXEC sp_OAMethod @crypt, 'VerifyP7M', @success OUT, @p7m_path, @out_path IF @success = 0 BEGIN EXEC sp_OAGetProperty @crypt, 'LastErrorText', @sTmp0 OUT PRINT @sTmp0 EXEC @hr = sp_OADestroy @crypt RETURN END -- Examine the certificate(s) used for signing. DECLARE @numSigners int EXEC sp_OAGetProperty @crypt, 'NumSignerCerts', @numSigners OUT DECLARE @i int SELECT @i = 0 DECLARE @cert int EXEC @hr = sp_OACreate 'Chilkat.Cert', @cert OUT WHILE @i < @numSigners BEGIN EXEC sp_OAMethod @crypt, 'LastSignerCert', @success OUT, @i, @cert EXEC sp_OAGetProperty @cert, 'SubjectDN', @sTmp0 OUT PRINT 'Signer: ' + @sTmp0 SELECT @i = @i + 1 END EXEC @hr = sp_OADestroy @crypt EXEC @hr = sp_OADestroy @cert END GO |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.