SetExternalDigestSignCallback
Security and signatures
Description
Registers the synchronous callback used by DLL or ActiveX external digest-signing processes
Syntax
ActiveX
Function PDFlib::SetExternalDigestSignCallback(Callback As Object) As Long
DLL
int DLSetExternalDigestSignCallback(int InstanceID, void* Callback, void* UserData);
int __stdcall Callback(int SignProcessID, const char* Digest, int DigestLength, int DigestAlgorithm, int SignatureAlgorithm, char* Signature, int SignatureCapacity, void* UserData);
Parameters
| Callback | ActiveX object exposing SignDigest, or a DLL function pointer using the signature shown above |
|---|---|
| UserData | Opaque DLL value passed back unchanged on every callback |
Callback contract
The ActiveX object method is SignDigest(SignProcessID, Digest, DigestAlgorithm, SignatureAlgorithm) and returns a byte-array variant containing the raw signature
The DLL callback writes no more than SignatureCapacity bytes and returns the number written, or a nonpositive value on failure
DigestAlgorithm uses the SetSignProcessDigestAlgorithm codes and SignatureAlgorithm uses the external signature format codes documented by SetSignProcessExternalDigestSigner
The callback receives only a fixed-length digest and never receives the PDF byte ranges or authenticated-attribute bytes
Return values
| 1 | The callback registration was updated |
|---|---|
| 0 | The DLL instance was invalid |