Sample code for 30+ languages & platforms
Delphi DLL

Workaround for the deprecated Crypt2.OpaqueVerifyBytesENC method

Shows how to replace the deprecated OpaqueVerifyBytesENC method. (Chilkat is moving away from the use of CkByteData.)

Chilkat Delphi DLL Downloads

Delphi DLL
uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
    Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, BinData, CkByteData, Crypt2;

...

procedure TForm1.Button1Click(Sender: TObject);
var
success: Boolean;
crypt: HCkCrypt2;
outData: HCkByteData;
bd: HCkBinData;

begin
success := False;

crypt := CkCrypt2_Create();

CkCrypt2_putEncodingMode(crypt,'base64');

// ------------------------------------------------------------------------
// The OpaqueVerifyBytesENC method is deprecated:

outData := CkByteData_Create();

success := CkCrypt2_OpaqueVerifyBytesENC(crypt,'base64 encoded p7m',outData);

// ------------------------------------------------------------------------
// Workaround.
// (Chilkat is moving away from using CkByteData)

bd := CkBinData_Create();
CkBinData_AppendEncoded(bd,'base64 encoded p7m','base64');

// If the opaque signature is validated, the contents of bd are replaced with the original data that was signed.
// 
success := CkCrypt2_OpaqueVerifyBd(crypt,bd);

CkCrypt2_Dispose(crypt);
CkByteData_Dispose(outData);
CkBinData_Dispose(bd);

end;