Delphi DLL Requires Chilkat v11.0.0+
Delphi DLL
Workaround for the deprecated Crypt2.VerifyBytesENC method
Shows how to replace the deprecated VerifyBytesENC method. (Chilkat is moving away from the use of CkByteData.)Chilkat Delphi DLL Downloads
var
crypt: HCkCrypt2;
originalDataPath: PWideChar;
base64_detached_signature: PWideChar;
originalDataBytes: HCkByteData;
verified: Boolean;
bdOrigData: HCkBinData;
begin
crypt := CkCrypt2_Create();
// Encoding mode property must match the encoding of the detached signature.
CkCrypt2_putEncodingMode(crypt,'base64');
originalDataPath := 'c:/someDir/example.dat';
base64_detached_signature := '....';
// ------------------------------------------------------------------------
// The VerifyBytesENC method is deprecated:
originalDataBytes := CkByteData_Create();
CkByteData_loadFile(originalDataBytes,originalDataPath);
verified := CkCrypt2_VerifyBytesENC(crypt,originalDataBytes,base64_detached_signature);
// ------------------------------------------------------------------------
// Workaround.
// (Chilkat is moving away from using CkByteData)
bdOrigData := CkBinData_Create();
CkBinData_LoadFile(bdOrigData,originalDataPath);
verified := CkCrypt2_VerifyBdENC(crypt,bdOrigData,base64_detached_signature);
CkCrypt2_Dispose(crypt);
CkByteData_Dispose(originalDataBytes);
CkBinData_Dispose(bdOrigData);