Acrobat Digital Signature API Reference - Adobe Partners
Acrobat Digital Signature API Reference - Adobe Partners
Acrobat Digital Signature API Reference - Adobe Partners
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
c<br />
<strong>Acrobat</strong> <strong>Digital</strong><br />
<strong>Signature</strong> <strong>API</strong><br />
<strong>Reference</strong><br />
Technical Note #5192<br />
Version: <strong>Acrobat</strong> 6.0<br />
ADOBE SYSTEMS INCORPORATED<br />
Corporate Headquarters<br />
345 Park Avenue<br />
San Jose, CA 95110-2704<br />
(408) 536-6000<br />
http://partners.adobe.com<br />
May, 2003
Copyright 2003 <strong>Adobe</strong> Systems Incorporated. All rights reserved.<br />
NOTICE: All information contained herein is the property of <strong>Adobe</strong> Systems Incorporated. No part of this publication (whether in hardcopy or<br />
electronic form) may be reproduced or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or<br />
otherwise, without the prior written consent of the <strong>Adobe</strong> Systems Incorporated.<br />
PostScript is a registered trademark of <strong>Adobe</strong> Systems Incorporated. All instances of the name PostScript in the text are references to the<br />
PostScript language as defined by <strong>Adobe</strong> Systems Incorporated unless otherwise stated. The name PostScript also is used as a product<br />
trademark for <strong>Adobe</strong> Systems’ implementation of the PostScript language interpreter.<br />
Except as otherwise stated, any reference to a “PostScript printing device,” “PostScript display device,” or similar item refers to a printing device,<br />
display device or item (respectively) that contains PostScript technology created or licensed by <strong>Adobe</strong> Systems Incorporated and not to devices<br />
or items that purport to be merely compatible with the PostScript language.<br />
<strong>Adobe</strong>, the <strong>Adobe</strong> logo, <strong>Acrobat</strong>, the <strong>Acrobat</strong> logo, <strong>Acrobat</strong> Capture, Distiller, PostScript, the PostScript logo and Reader are either registered<br />
trademarks or trademarks of <strong>Adobe</strong> Systems Incorporated in the United States and/or other countries.<br />
Apple, Macintosh, and Power Macintosh are trademarks of Apple Computer, Inc., registered in the United States and other countries. PowerPC<br />
is a registered trademark of IBM Corporation in the United States. ActiveX, Microsoft, Windows, and Windows NT are either registered<br />
trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. UNIX is a registered trademark of The Open<br />
Group. All other trademarks are the property of their respective owners.<br />
This publication and the information herein is furnished AS IS, is subject to change without notice, and should not be construed as a<br />
commitment by <strong>Adobe</strong> Systems Incorporated. <strong>Adobe</strong> Systems Incorporated assumes no responsibility or liability for any errors or inaccuracies,<br />
makes no warranty of any kind (express, implied, or statutory) with respect to this publication, and expressly disclaims any and all warranties<br />
of merchantability, fitness for particular purposes, and noninfringement of third party rights.
<strong>Acrobat</strong> SDK Documentation Roadmap<br />
Getting Started<br />
Getting Started Using the <strong>Acrobat</strong> Software Development Kit<br />
<strong>Acrobat</strong> SDK Release Notes <strong>Acrobat</strong> Developer FAQ Reader Enabling<br />
<strong>Acrobat</strong> Development Overview <strong>Acrobat</strong> Plug-in Tutorial <strong>Acrobat</strong> SDK Samples Guide<br />
PDF Specification<br />
PDF <strong>Reference</strong><br />
Manual<br />
Upgrading Plug-ins from <strong>Acrobat</strong> 5.0 to <strong>Acrobat</strong> 6.0<br />
<strong>Acrobat</strong> Core <strong>API</strong><br />
<strong>Acrobat</strong> Core<br />
<strong>API</strong> Overview<br />
Extended <strong>API</strong> for Plug-in<br />
AcroColor <strong>API</strong> <strong>Reference</strong><br />
PDF Creation <strong>API</strong>s<br />
and Specifications<br />
<strong>Acrobat</strong> Distiller<br />
Parameters<br />
JavaScript<br />
<strong>Acrobat</strong> JavaScript<br />
Scripting<br />
<strong>Reference</strong><br />
<strong>Acrobat</strong> Interapplication<br />
Communication (IAC)<br />
<strong>Acrobat</strong> IAC Overview<br />
<strong>Acrobat</strong> Core<br />
<strong>API</strong> <strong>Reference</strong><br />
ADM Programmer’s<br />
Guide and <strong>Reference</strong><br />
<strong>Acrobat</strong> Distiller<br />
<strong>API</strong> <strong>Reference</strong><br />
<strong>Acrobat</strong><br />
JavaScript<br />
Scripting Guide<br />
<strong>Acrobat</strong> IAC <strong>Reference</strong><br />
Catalog <strong>API</strong> <strong>Reference</strong><br />
<strong>Digital</strong> <strong>Signature</strong> <strong>API</strong><br />
<strong>Reference</strong><br />
pdfmark<br />
<strong>Reference</strong><br />
Programming<br />
<strong>Acrobat</strong> JavaScript<br />
Using Visual Basic<br />
Forms <strong>API</strong> <strong>Reference</strong><br />
PDF Consultant<br />
Accessibility Checker<br />
Search <strong>API</strong> <strong>Reference</strong><br />
Spelling <strong>API</strong> <strong>Reference</strong><br />
Using the Save as<br />
XML Plug-in<br />
Weblink <strong>API</strong> <strong>Reference</strong>
Contents<br />
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11<br />
What Is in This Document. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11<br />
Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12<br />
Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12<br />
Other Useful Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12<br />
Conventions Used in This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13<br />
Chapter 1 <strong>Digital</strong> <strong>Signature</strong> Overview . . . . . . . . . . . . . . . . . . . . . 15<br />
Plug-in Relationships . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15<br />
The PubSec Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15<br />
<strong>Digital</strong> <strong>Signature</strong> Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16<br />
<strong>Digital</strong> <strong>Signature</strong> Scenarios. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17<br />
Initializing a Plug-in to Work With the <strong>Digital</strong> <strong>Signature</strong> Plug-in. . . . . . . . . . . . . . . . . . . . 17<br />
Handling Document Open and Close Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18<br />
Understanding the Process. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18<br />
Dialogs and <strong>Signature</strong> Gathering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18<br />
Saving a Document. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18<br />
Finishing the Process. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19<br />
Revalidating <strong>Signature</strong>s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20<br />
Additional Available Callbacks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20<br />
Additional DigSig Plug-in Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21<br />
Rollback Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21<br />
Chapter 2 PubSec Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23<br />
General PubSec Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23<br />
PSCertIssuedUnderTestCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23<br />
PSCloseEncryptedDocs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24<br />
PSCountEncryptedDocs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25<br />
PSDataBufferDigest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26<br />
PSDataBufferEnum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27<br />
PSExportDataExchange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28<br />
PSImportDataExchange. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29<br />
PSRegisterHandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30<br />
PSSigValidatePDDocSigField . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 5
Contents<br />
PSUnregisterHandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32<br />
PubSec <strong>Acrobat</strong> Address Book Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33<br />
AABFindCertsByName. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33<br />
AABGetCertChain. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34<br />
AABGetCertTrust . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35<br />
AABGetTrustedCerts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36<br />
AABIsCertPresent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37<br />
<strong>Digital</strong> <strong>Signature</strong> Appearance File Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38<br />
DSAPFileAcquire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38<br />
DSAPFileCanDeleteNthEntry. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39<br />
DSAPFileCopyNthEntry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40<br />
DSAPFileEditNthEntry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41<br />
DSAPFileGetCount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42<br />
DSAPFileGetNewNthName. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43<br />
DSAPFileRelease . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44<br />
DSAPFileRemoveNthEntry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45<br />
DSAPFileSave . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46<br />
Chapter 3 PubSec Callbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . 49<br />
PSDestroyEngineProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49<br />
PSExportDataProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50<br />
PSGetAtomPropertyProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51<br />
PSGetBoolPropertyProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52<br />
PSGetDirHandlerInfo. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53<br />
PSGetDirInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54<br />
PSGetDirList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55<br />
PSGetImplicitRecipientsProc. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56<br />
PSGetInt32PropertyProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57<br />
PSGetLogoProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58<br />
PSGetTextPropertyProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59<br />
PSImportDataProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60<br />
PSNewEngineProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61<br />
PSOpenCMSEnvelopeProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62<br />
PSOpenConnection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63<br />
PSPerformOperationProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64<br />
PSSessionAcquireProc. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65<br />
PSSessionReadyProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66<br />
PSSessionReleaseProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67<br />
PSSetDirInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68<br />
PSSigAuthenticateProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69<br />
PSSigCreateAPNXObjProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70<br />
PSSigGetSigPropertiesProc. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71<br />
PSSigGetSigValueProc. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72<br />
PSSigPropDialogProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73<br />
PSSigValGetAPLabelProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74<br />
6 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
Contents<br />
PSSigValGetTextProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75<br />
PSSigValidateDialogProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76<br />
PSSigValidateProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77<br />
PSSigValidateSupportedProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78<br />
Chapter 4 PubSec Declarations . . . . . . . . . . . . . . . . . . . . . . . . . 79<br />
APPreview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79<br />
DirAuthenticationContext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81<br />
DirConnection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82<br />
DirectoryInfo. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83<br />
DirectoryList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85<br />
DirectoryInfo. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86<br />
DirHandlerInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87<br />
DSAPFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88<br />
DSDigestMethod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89<br />
DSPropertyType. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90<br />
DSRetCode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91<br />
DSSaveType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92<br />
DSSigValText. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93<br />
PSAPSigType. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95<br />
PSDataBuffer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96<br />
PSExportDataExchangeParams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97<br />
PSExportDataType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100<br />
PSExportDestType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101<br />
PSImportDataExchangeParams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102<br />
PSImportDataParams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103<br />
PSImportDataType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104<br />
PSOpenCMSEnvelopeParams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105<br />
PSPerformOpType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .106<br />
PSSessionOpType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107<br />
PSSigCosDocParams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .109<br />
PSSigDataBufferParams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .110<br />
PSSigDocType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111<br />
PSSigDialogStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .112<br />
PSSigFileType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .113<br />
PSSigMethod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .114<br />
PSSigPDDocParams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115<br />
PSSigGetSigValueParams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116<br />
PSSigSigPropParams. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .118<br />
PSSigTrust . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .120<br />
PSSigValidateParams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121<br />
PSSigValidateDialogParams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123<br />
PSSigValidateSupportParams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125<br />
PSSigValSupport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .126<br />
PubSecEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127<br />
PubSecHandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .128<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 7
Contents<br />
Chapter 5 <strong>Digital</strong> <strong>Signature</strong> Methods . . . . . . . . . . . . . . . . . . . . . 133<br />
DigSigAddedSig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .133<br />
DigSigAddedSigEx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .134<br />
DSAPCreateCompositeTextXObj . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .135<br />
DigSigAPCreateLayeredStream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .136<br />
DigSigAPCreateLayeredStreamEx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .138<br />
DigSigAPXObjectFromLogo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .139<br />
DigSigAPXObjectFromXObjList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .140<br />
DigSigByteToHex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .141<br />
DigSigClearSig. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .142<br />
DigSigClearSigRefDict . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .143<br />
DigSigClick . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .144<br />
DigSigCommitSigRefDict . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .145<br />
DigSigComparePages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .146<br />
DigSigComparePagesEx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .147<br />
DigSigCompareWords. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .148<br />
DigSigCompareWordsAndFontsRecent. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .149<br />
DigSigCompareWordsEx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .150<br />
DigSigCompareWordsRecent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .151<br />
DigSigCosObjOverwrite. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .152<br />
DigSigCreateStdXObj . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .154<br />
DigSigDeletedSig. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .155<br />
DigSigDeletedSigEx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .156<br />
DigSigDocModifiedAfterSig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .157<br />
DigSigDoProperties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .158<br />
DigSigDraw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .159<br />
DigSigEnum<strong>Signature</strong>s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .160<br />
DigSigFileGetEOF. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .161<br />
DigSigFileRead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .162<br />
DigSigFileSetPos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .163<br />
DigSigFinishSigRefDict . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .164<br />
DigSigGetDocAuthor<strong>Signature</strong> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .165<br />
DigSigGetDocMDPSetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .166<br />
DigSigGetStdXObj . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .167<br />
DigSigGetUbiquity<strong>Signature</strong> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .168<br />
DigSigGetUniqueTitle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .169<br />
DigSigHexToByte . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .170<br />
DigSigIsDocSigned . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .171<br />
DigSigIsSigSigned . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .172<br />
DigSigKeyDown. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .173<br />
DigSigMD5ByteRange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .174<br />
DigSigNewSigRefDict . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .175<br />
DigSigOverwriteBytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .176<br />
DigSigOverwriteHexstring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .177<br />
DigSigOverwriteIntArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .178<br />
DigSigRegisterFilter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .179<br />
8 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
Contents<br />
DigSigRegisterObserver. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .180<br />
DigSigRightClick . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .181<br />
DigSigRollbackToSig. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .182<br />
DigSigSignDoc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .183<br />
DigSigUnregisterFilter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .184<br />
DigSigUnregisterObserver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .185<br />
DigSigUpdatePanel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .186<br />
DigSigVerifySig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .187<br />
DigSigVerifySigRefDict . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .188<br />
Chapter 6 <strong>Digital</strong> <strong>Signature</strong> Callbacks . . . . . . . . . . . . . . . . . . . . 189<br />
DigSigEnumProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .189<br />
DSCanValidateProc. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .190<br />
DSClearSigProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .191<br />
DSCommitSignProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .192<br />
DSDefaultValueProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .193<br />
DSDocCloseProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .194<br />
DSDocOpenProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .195<br />
DSFinishSignProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .196<br />
DSFreeSigDataProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .197<br />
DSGetBoolPropertyProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .198<br />
DSGetSigPropProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .199<br />
DSGetStatusTextProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .200<br />
DSGetValidStateProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .201<br />
DSNewSigDataProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .202<br />
DSNewSigDataWithParamsProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .203<br />
DSNotificationProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .204<br />
DSNotificationFailureProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .205<br />
DSPropertiesProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .206<br />
DSPropertiesExProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .207<br />
DSReValidateSigProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .208<br />
DSSigDataGetErrorTextProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .209<br />
DSUnValidateSigProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .210<br />
DSValidateSigProc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .211<br />
Chapter 7 <strong>Digital</strong> <strong>Signature</strong> Declarations. . . . . . . . . . . . . . . . . . . 215<br />
DigSigBBox. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .215<br />
DigSigHandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .216<br />
DigSigNewSigDataParams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .219<br />
DigSigOffset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .221<br />
DigSigOffsetRec. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .221<br />
DSAPCreateLayeredStreamExParams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .222<br />
DSAPTextEntry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .224<br />
DSAPXObjEntry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .225<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 9
Contents<br />
DSAPXObjEntryRec. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .225<br />
DSComparePagesParams. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .227<br />
DSCompareWordsParams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .228<br />
DSHandlerProperty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .229<br />
DSMDPType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .230<br />
DSNotificationType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .231<br />
DSNotifyParams. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .233<br />
DSOverwriteType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .234<br />
DSQuadding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .235<br />
DSSigRefDictErrParams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .236<br />
DSSigRefDictParams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .237<br />
DSSigRefErrCode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .238<br />
DSValidState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .239<br />
DSXObjType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .240<br />
Chapter 8 <strong>Digital</strong> <strong>Signature</strong>’s Use of Core <strong>API</strong> Objects . . . . . . . . . . . 241<br />
ASAtom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .241<br />
ASCab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .241<br />
ASFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .241<br />
ASText . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .241<br />
AVPageView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .241<br />
CosDoc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .241<br />
CosObj . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .241<br />
PDAnnot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .242<br />
PDDoc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .242<br />
10 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
Preface<br />
<strong>Digital</strong> signatures allow a person to attest to something about a document by signing their<br />
name to it. An <strong>Acrobat</strong> signature in a document is bound to that document in such a way<br />
that altering the signed document or moving the signature to a different document<br />
invalidates the signature.<br />
A single document may be signed more than once, and changes may occur between<br />
signings. <strong>Acrobat</strong>’s <strong>Digital</strong> <strong>Signature</strong>s links each signature with a particular state of the<br />
document. All changes append the PDF changes to the fully-preserved base PDF<br />
document. The ability to do serial signatures of protected documents is unique to <strong>Acrobat</strong>,<br />
and draws heavily on the PDF file design for an appended save.<br />
<strong>Adobe</strong> <strong>Acrobat</strong> implements digital signatures using plug-ins that can handle both generic<br />
functions common to all digital signatures, and also specific kinds of signatures (signing<br />
methods), such as public-private key (PPK), handwriting, retinal scans, fingerprints, and so<br />
forth.<br />
If you received this technical note without obtaining the entire <strong>Acrobat</strong> Software<br />
Development Kit (SDK), you can get the complete SDK by visiting:<br />
http://partners.adobe.com/asn/developer/acrosdk/main.html<br />
What Is in This Document<br />
This document provides a reference for the methods, callbacks declarations and objects<br />
used in creating digital signatures. This document contains separate sections on each:<br />
● <strong>Digital</strong> <strong>Signature</strong> Overview provides a general overview of how to work with the digital<br />
signature plug-in.<br />
● PubSec Methods provides detailed descriptions of the methods and structures in the<br />
PubSec access layer, which forms a high-level interface to the digital signature facility.<br />
● PubSec Callbacks provides detailed description of PubSec callback functions, which the<br />
<strong>Acrobat</strong> viewer and Library use to invoke functionality provided by plug-ins and<br />
applications.<br />
● PubSec Declarations provides detailed descriptions of data declarations used in the<br />
PubSec access layer.<br />
● <strong>Digital</strong> <strong>Signature</strong> Methods provides detailed descriptions of each method, including its<br />
parameters and return value.<br />
● <strong>Digital</strong> <strong>Signature</strong> Callbacks provides detailed description of callback functions, which<br />
the <strong>Acrobat</strong> viewer and Library use to invoke functionality provided by plug-ins and<br />
applications.<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 11
Preface<br />
Audience<br />
●<br />
●<br />
<strong>Digital</strong> <strong>Signature</strong> Declarations provides detailed descriptions of data structures used by<br />
the <strong>Acrobat</strong> viewer and Library.<br />
<strong>Digital</strong> <strong>Signature</strong>’s Use of Core <strong>API</strong> Objects provides a list of objects used by the <strong>Digital</strong><br />
<strong>Signature</strong>s plug-in. This list enables you to easily find in the Core <strong>API</strong> <strong>Reference</strong> objects<br />
you will probably use while creating your plug-in..<br />
Audience<br />
You should read this document if you are a security developer who wants to extend your<br />
security measures to your customers’ PDF documents. This document assumes that you are<br />
writing plug-ins to customize <strong>Acrobat</strong>’s <strong>Digital</strong> <strong>Signature</strong> capabilities to your customers’<br />
needs.<br />
Prerequisites<br />
You should already be familiar with the process for creating <strong>Acrobat</strong> plug-ins. If you are not,<br />
please read the <strong>Acrobat</strong> Plug-In Tutorial.<br />
Other Useful Documentation<br />
The <strong>Acrobat</strong> SDK includes many other books that you might find useful. When mentioned<br />
in this document, those books will often appear as live links (blue italic links). However, in<br />
order to actually jump from this document to those books, those books must exist in the<br />
proper directories within your computer's file system. This happens automatically when<br />
you install the SDK onto your system.<br />
If for some reason you did not install the entire SDK onto your system and you do not have<br />
all of the documentation, please visit the <strong>Adobe</strong> Solutions Network web site<br />
(http://partners.adobe.com/asn) to find the books you need. Then download them and<br />
install them in the proper directories, which can be determined by looking at the <strong>Acrobat</strong><br />
SDK Documentation Roadmap, included at the beginning of each book in the SDK.<br />
You should be familiar with the <strong>Acrobat</strong> core <strong>API</strong> and Portable Document Format (PDF). The<br />
following technical notes provide this information.<br />
<strong>Acrobat</strong> Core <strong>API</strong> Overview, Technical Note #5190. Gives an overview of the objects and<br />
methods provided by the <strong>Acrobat</strong> core <strong>API</strong>.<br />
<strong>Acrobat</strong> Core <strong>API</strong> <strong>Reference</strong>, Technical Note #5191. Describes in detail the objects and<br />
methods provided by the <strong>Acrobat</strong> core <strong>API</strong>.<br />
PDF <strong>Reference</strong>, Fourth Edition, version 1.5. Provides a description of the PDF file format, as<br />
well as suggestions for producing efficient PDF files. It is intended for application<br />
developers who wish to produce PDF files directly.<br />
12 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
Preface<br />
Conventions Used in This Book<br />
Conventions Used in This Book<br />
The <strong>Acrobat</strong> documentation uses text styles according to the following conventions.<br />
Font Used for Examples<br />
monospaced Paths and filenames C:\templates\mytmpl.fm<br />
monospaced bold<br />
Code examples set off<br />
from plain text<br />
Code items within plain<br />
text<br />
Parameter names and<br />
literal values in<br />
reference documents<br />
These are variable declarations:<br />
AVMenu commandMenu,helpMenu;<br />
The GetExtensionID method ...<br />
The enumeration terminates if proc<br />
returns false.<br />
monospaced italic Pseudocode ACCB1 void ACCB2 ExeProc(void)<br />
{ do something }<br />
Placeholders in code<br />
examples<br />
AFSimple_Calculate (cFunction,<br />
cFields)<br />
blue Live links to Web pages The <strong>Acrobat</strong> Solutions Network URL is:<br />
http://partners/adobe.com/asn/<br />
bold<br />
italic<br />
Live links to sections<br />
within this document<br />
Live links to other<br />
<strong>Acrobat</strong> SDK documents<br />
Live links to code items<br />
within this document<br />
PostScript language and<br />
PDF operators,<br />
keywords, dictionary<br />
key names<br />
User interface names<br />
Document titles that are<br />
not live links<br />
New terms<br />
PostScript variables<br />
See Using the SDK.<br />
See the <strong>Acrobat</strong> Core <strong>API</strong> Overview.<br />
Test whether an ASAtom exists.<br />
The setpagedevice operator<br />
The File menu<br />
<strong>Acrobat</strong> Core <strong>API</strong> Overview<br />
User space specifies coordinates for...<br />
filename deletefile<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 13
Preface<br />
Conventions Used in This Book<br />
14 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
1<br />
<strong>Digital</strong> <strong>Signature</strong> Overview<br />
Plug-in Relationships<br />
The following figure illustrates the security plug-in relationships.<br />
<strong>Adobe</strong> <strong>Acrobat</strong><br />
<strong>Acrobat</strong> <strong>API</strong><br />
PDCrypt<br />
LegalPDF<br />
Scrubber Agent<br />
(plug-in)<br />
DigSig (plug-in)<br />
DigSigHFT<br />
PubSec<br />
PubSecHFT<br />
Self-Sign<br />
(PPKLite Handler)<br />
MSC<strong>API</strong> and ADSI<br />
interface<br />
(PPKMS Handler)<br />
<strong>Acrobat</strong> Address Book<br />
(AAB Handler)<br />
3rd party<br />
PubSec<br />
handlers<br />
PKCS#12<br />
File<br />
Microsoft OS<br />
CSP CSP CSP ...<br />
User<br />
Contact<br />
File<br />
The PubSec Layer<br />
The PubSec layer, introduced in <strong>Acrobat</strong> 6.0, is an interface for <strong>Acrobat</strong> public-key security<br />
handlers. PubSec forms a high-level interface to the digital signature facility; the PubSec<br />
code uses DigSig for digital signature operations, but provides many additional benefits.<br />
Developers are encouraged to use the PubSec HFT rather then DigSig HFT.<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 15
1<br />
<strong>Digital</strong> <strong>Signature</strong> Overview<br />
<strong>Digital</strong> <strong>Signature</strong> Components<br />
PubSec provides functions to:<br />
●<br />
●<br />
●<br />
Count and close encrypted documents.<br />
Validate a specific signature field.<br />
Access and create digests for data buffers.<br />
● Import and export certificate data, and manage the certificates in the <strong>Acrobat</strong> Address<br />
Book (AAB).<br />
● Manage signature appearances (DSAP files).<br />
● Register and unregister handlers. Handlers can register as PubSec handlers to provide<br />
the following cryptographic services:<br />
– Do private-key signing and signature validation<br />
– Act as a cryptographic source for decrypting using private keys<br />
– Act as a directory source for certificate-based identity authentication<br />
Handlers can call back into the PubSec HFT for various services. Most calls to PubSec pass<br />
an opaque state object called a PSEngine. You specify a default engine upon registering the<br />
handler, and the default engine can make use of the security UI dialogs provided by PubSec<br />
and DigSig.<br />
To register a handler with PubSec:<br />
1. Implement the callbacks you need to provide customized functionality. Many of the<br />
callbacks for PubSec can be specified as NULL, in which case PubSec provides default<br />
behavior. It is recommended that you use the default behavior when possible.<br />
2. Fill in the handler structure with pointers to your callback implementations<br />
(PubSecHandler).<br />
3. Register the handler with PubSec (PSRegisterHandler).<br />
<strong>Digital</strong> <strong>Signature</strong> Components<br />
<strong>Digital</strong> signatures contain two parts:<br />
● The signature field dictionary: the PDF dictionary structure that stores information<br />
about the signature<br />
● The signature annotation with its associated appearance (including the background,<br />
and layout of name, time, and so on). A blind digital signature does not have an<br />
associated appearance.<br />
<strong>Acrobat</strong>’s <strong>Digital</strong> <strong>Signature</strong> plug-in creates these two parts when the user chooses to sign a<br />
document. Your plug-ins do not have to handle deleting the signature, as the DigSig plugin<br />
does that transparently.<br />
16 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Overview<br />
<strong>Digital</strong> <strong>Signature</strong> Scenarios<br />
1<br />
<strong>Digital</strong> <strong>Signature</strong> Scenarios<br />
<strong>Acrobat</strong> supports three digital signature scenarios. <strong>Acrobat</strong>’s <strong>Digital</strong> <strong>Signature</strong> plug-in<br />
handles the first case, and allows other plug-ins to further handle the second and the third<br />
cases.<br />
1. If the user creates a signature field and does not specify a default signing method,<br />
DigSig handles that case with no communication to your plug-ins:<br />
– DigSig creates the signature field dictionary.<br />
– DigSig creates the signature annotation dictionary.<br />
– DigSig creates the (blank) signature appearance dictionary.<br />
2. The Forms plug-in also creates <strong>Signature</strong> fields. If the user creates a signature field and<br />
specifies a default method, Forms calls DigSig to fill in default values:<br />
– DigSig creates the signature field dictionary, the signature annotation dictionary, and<br />
the (blank) signature appearance dictionary.<br />
– DigSig calls the DSDefaultValueProc callback that your plugin provides. This<br />
callback must create the default signature value dictionary and create the /DV key in<br />
the signature field dictionary to point to it.<br />
3. If the user asks to sign a specific signature field using the plug-in, DigSig calls callbacks<br />
into your plug-in in four-step sequence. Your plug-in must register these callbacks<br />
during the plug-in initialization phase. The four callbacks required for this scenario are:<br />
– dsNewSigData<br />
– dsCommitSign<br />
– dsFinshSign<br />
– dsFreeSigData.<br />
Initializing a Plug-in to Work With the <strong>Digital</strong> <strong>Signature</strong> Plug-in<br />
When <strong>Acrobat</strong> launches, all plug-ins go through a three-step initialization process that<br />
allows plug-ins to establish communication among themselves without being dependent<br />
on the order of loading. For plug-ins that interact with <strong>Acrobat</strong>’s <strong>Digital</strong> <strong>Signature</strong> plug-in<br />
(DigSig), use the following intialization sequence:<br />
1. Export Host Function Tables (HFTs). DigSig exports its HFT under the name DigSigHFT.<br />
2. Import HFTs. To work with DigSig, your plug-in must import the DigSig HFT.<br />
3. Perform initialization. To work with DigSig, your plug-in must create a<br />
DigSigHandlerRec structure, assign the relevant methods, and then call<br />
DigSigRegisterFilter to register the structure.<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 17
1<br />
<strong>Digital</strong> <strong>Signature</strong> Overview<br />
Understanding the Process<br />
Handling Document Open and Close Operations<br />
When the user opens a document, DigSig calls your plug-ins to notify them of the new<br />
document by calling DSDocOpenProc; you might allocate some storage or choose to<br />
automatically validate any of their respective signatures in the document.<br />
Auto-validation may produce significant delays if it must read all of a large document from<br />
a CD-ROM or over a network, or if it must access a signature registry or authority over a<br />
network. Therefor, <strong>Adobe</strong> software only accesses signatures at user request.<br />
When the user closes a document, DigSig calls DSDocCloseProc.<br />
Understanding the Process<br />
The steps in this section are suggestions that describe the interactions of a digital signature<br />
plug-in. (The SignDoc sample plug-in provided with this SDK is a more complete<br />
example.)<br />
Dialogs and <strong>Signature</strong> Gathering<br />
1. DigSig calls your dsNewSigDataProc, a callback that begins the process.<br />
– Your plug-in interacts with the user, and allows the user to cancel if they want to do so.<br />
– Your plug-in acquires the signature itself in a method-specific way. All information is<br />
saved in memory, without altering the document itself. This allows a later backout.<br />
– If dsNewSigData does not cancel, DigSig prepares the document for saving: It first<br />
calls dsUnValidateSig on every signature in the document to put any<br />
overprinting/underprinting in canonical form. It then counts how many pages and<br />
fields have changed since any prior signature and records this.<br />
– For a first signature, DigSig does the SaveAs dialog, allowing the user to select<br />
filename, optimization, and encryption. The user may cancel. Other than fatal errors,<br />
such as out-of-disk-space, this is the last chance to stop the process.<br />
Saving a Document<br />
1. DigSig calls Xxxx.DSCommitSignProc to update the document with the actual<br />
signature.<br />
Your DSCommitSignProc callback must:<br />
– create the signature dictionary, possibly using information in the signature field /DV<br />
dictionary, perhaps using the /ByteRange and /Contents keys.<br />
– point /V in the signature field dictionary to this. Then create the /AP /N value in the<br />
signature annotation dictionary, using a method-specific visible representation of the<br />
signature, including a symbol signifying “unvalidated signature.”<br />
– optionally allocate dynamic storage for a marked array, an array of “marked” COS<br />
objects that it cares about.<br />
18 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Overview<br />
Understanding the Process<br />
1<br />
– return a marked array that includes at least the /ByteRange and /Contents value<br />
objects.<br />
2. DigSig inserts the /Changes array from step 1.<br />
3. DigSig saves the PDF document to a file. For each Cos object in the marked array, DigSig<br />
records the object’s byte offset and length in the file as written. The saved file may have<br />
objects encrypted by the <strong>Acrobat</strong> standard encryption handler, if the user so chooses.<br />
4. The very first time a document is signed, DigSig may rename the file and may invoke the<br />
Optimizer, Linearizer, and Garbage Collector. Upon return from the save, all COS objects<br />
are invalid, including those in the marked array.<br />
– All PD-level objects except the PDDoc are invalid. Signing methods must not depend<br />
on saving any such state between dsCommitSign and dsFinishSign. In<br />
particular, the byte offsets and lengths in the marked array are valid upon entry to<br />
doSign, but the Cos objects are not. The order of entries is unchanged, however,<br />
these Cos objects will be rewritten by DigSig as CosNull before calling<br />
dsFinishSign.<br />
Finishing the Process<br />
1. DigSig calls dsFinishSign, passing back in the marked array.<br />
Your DSFinishSignProc must:<br />
– Calculate the /ByteRange that it desires, using the byte offsets and lengths in the<br />
marked array.<br />
– Overwrite the marked /ByteRange value in the saved file, using the<br />
DigSigOverwriteIntArray or DigSigOverwriteBytes callback.<br />
– Overwrite any other marked Cos objects it wants to.<br />
– Calculate any document digest that it desires, using the DigSigFileGetEOF,<br />
DigSigFileSetPos, and DigSigFileRead callbacks; or it may use the<br />
DigSigMD5ByteRange callback.<br />
– Obscure or encrypt this digest in a method-specific way.<br />
– Overwrite the marked /Contents value in the saved file, using<br />
DigSigOverwriteHexstring or DigSigOverwriteBytes.<br />
– Optionally delete dynamic storage for the marked array the plug-in returns.<br />
2. DigSig calls dsFreeSigData, which may free up any remaining storage.<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 19
1<br />
<strong>Digital</strong> <strong>Signature</strong> Overview<br />
Understanding the Process<br />
Revalidating <strong>Signature</strong>s<br />
If the user reopens the file, the signatures must be revalidated. If the user asks to validate<br />
one or more signature fields, DigSig sequences through them one at a time:<br />
1. DigSig calls validateSign. Your DSValidateSignProc must:<br />
– Recalculate any document digest that it desires, using the DigSigFileGetEOF,<br />
DigSigFileSetPos, and DigSigFileRead callbacks; or it may use the<br />
DigSigMD5ByteRange callback.<br />
– Compar this result to the stored one, and do any other method-specific checks it<br />
desires.<br />
– Optionally do a validation against some stored (network) registry.<br />
– Update the /AP /N value in the signature annotation dictionary to show<br />
doublechecked/pass/fail symbol.<br />
– Return doublechecked/pass/fail.<br />
The user may open more than one document at a time, and may switch between open<br />
documents at will.<br />
Additional Available Callbacks<br />
The user may ask to show a signature panel containing summary information for each<br />
signature in an open document. If multiple documents are open, there may be multiple<br />
panels, or a single panel may be repainted as the user switches between documents. DigSig<br />
manages updating the panel(s), but may call the respective method plug-in for each<br />
signature to get information to display on the panel. For each signature, the signature<br />
panel has two levels of detail:<br />
1. CLOSED displays a doublechecked/pass/fail/unknown/blank icon and a line<br />
of text for each signature field in the document. The default text is the name of the<br />
person signing and the date and time of signing, displayed in a language-independent<br />
way.<br />
2. DigSig calls dsGetValidState to choose which icon to show.<br />
3. OPEN displays an icon and line of text for each signature, then indented lines of further<br />
text, currently consisting of the name of the signer, date and time of signing, location of<br />
signing, reason for signing, and signing method.<br />
4. DigSig calls dsGetValidState to choose which icon to show.<br />
Your plug-in may update the signature panel for a document asynchronously (it might be<br />
doing validation as a background or idle-loop task). To do this, use the<br />
DigSigUpdatePanel callback.<br />
20 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Overview<br />
Understanding the Process<br />
1<br />
Additional DigSig Plug-in Support<br />
Whenever a signature is created or verified, the plug-in may optionally alter the appearance<br />
of the signature in the document, for the purpose of displaying or printing. For example, it<br />
could change an overprinted question mark on an unverified signature to an underprinted<br />
logo for a verified signature. To help with this, DigSig provides an HFT callback<br />
DigSigGetStdXObj that returns an XObject for a blank appearance, a question mark,<br />
or a cross. These are suitable as targets of the Do operator in a signature’s appearance<br />
stream.<br />
To avoid saving a signature to a file with an appearance of valid (rather than unvalidated),<br />
just before each file save, DigSig loops through all the signature fields and calls the specific<br />
method’s dsUnValidateSig entry. This routine restores the signature’s appearance to<br />
the unvalidated state.<br />
The AcroForms Widget Annothandler calls into DigSig using four entries. These calls all<br />
reflect user actions taken in the document view, not the <strong>Signature</strong>s panel view.<br />
When the user selects an annotation by tabbing to it or by clicking it with the mouse, and<br />
that annotation is for a signature field, AcroForms calls DigSigDraw. If the annotation is<br />
selected, then bIsSelected is true.<br />
When the user tabs to a signature annotation and activates it by hitting the spacebar or<br />
enter key, this is equivalent to a left mouse click.<br />
AcroForms calls DigSigKeyDown. The parameters parallel those of<br />
AVAnnotHandlerDoKeyDownProc.<br />
When the user left-clicks inside a signature annotation, AcroForms calls DigSigClick.<br />
The parameters parallel those of DoClickProcType.<br />
When the user right-clicks inside a signature annotation, AcroForms calls<br />
DigSigRightClick.<br />
Rollback Support<br />
There is a constraint on the values in the /ByteRange array. This constraint allows DigSig to<br />
implement rollback to prior signatures:<br />
The largest offset + length value in the /ByteRange array for a given signature must be<br />
equal to the length of the PDF file containing that signature; that is, it must equal offset + 1<br />
of the "F" in the %%EOF at the end of the file.<br />
In addition, the following constraints also apply:<br />
● All offsets must be in the range 0..2147483647<br />
● All lengths must be in the range 1..2147483647<br />
● Offset[n+1] must be strictly greater than offset[n] + length[n]<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 21
1<br />
<strong>Digital</strong> <strong>Signature</strong> Overview<br />
Understanding the Process<br />
22 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
2<br />
PubSec Methods<br />
These methods form a high-level interface to the digital signature facility. Methods are<br />
presented in the following groups:<br />
● General PubSec Methods<br />
● PubSec <strong>Acrobat</strong> Address Book Methods<br />
● <strong>Digital</strong> <strong>Signature</strong> Appearance File Methods<br />
General PubSec Methods<br />
PSCertIssuedUnderTestCP<br />
ASBool PSCertIssuedUnderTestCP (ASCab inCertChain);<br />
Description<br />
Tests whether any certificate in a chain has been issued under the <strong>Adobe</strong> Test Certificate<br />
Policy.<br />
If this function returns true, PubSec handlers are recommended to provide feedback to<br />
the user regarding the test nature of the certificate, which may render it untrustworthy.<br />
Parameters<br />
inCertChain<br />
The certificate chain to test, as an ASCab array. The first certificate is<br />
the end entity, and certificates should follow in the issuing order. For<br />
example:<br />
{ ("0", cert1), ("1", cert2), ... }<br />
where certn is an X509 certificate as ASN1-encoded binary data.<br />
Return Value<br />
true if any certificate in the chain was issued under the <strong>Adobe</strong> Test Certificate Policy,<br />
false otherwise.<br />
Header File<br />
PubSecHFT.h<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 23
2<br />
PubSec Methods<br />
General PubSec Methods<br />
PSCloseEncryptedDocs<br />
ASBool PSCloseEncryptedDocs (PubSecEngine engine);<br />
Description<br />
Closes all encrypted documents associated with a PubSec engine, regardless of whether<br />
they need to be saved or not. Use PSCountEncryptedDocs to determine if there are<br />
any documents that will need to be opened or saved.<br />
PubSec keeps a list of all open encrypted documents. For security reasons, handlers will<br />
want all of these documents to be closed when it releases access to critical resources, for<br />
example when logging out. Use this method (rather than closing the documents directly)<br />
so that PubSec can maintain its cache correctly.<br />
Parameters<br />
engine<br />
The engine for which the encrypted docs are closed.<br />
Return Value<br />
true if successful, false otherwise.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSCountEncryptedDocs<br />
24 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Methods<br />
General PubSec Methods<br />
2<br />
PSCountEncryptedDocs<br />
void PSCountEncryptedDocs (PubSecEngine engine,<br />
ASUns32 *outNeedSave, ASUns32 *outCanClose);<br />
Description<br />
Returns the number of encrypted documents associated with a PubSec engine. Returns<br />
separate values for documents that need to be saved, and for those that do not need to be<br />
saved and can be safely closed.<br />
Parameters<br />
engine<br />
outNeedSave<br />
outCanClose<br />
The engine for which the encrypted docs are counted.<br />
(Filled by the method) A pointer to the number of encrypted<br />
documents associated with the engine that need to be saved.<br />
(Filled by the method) A pointer to the number of encrypted<br />
documents associated with the engine that do not need to be saved<br />
and can be safely closed.<br />
Return Value<br />
None<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSCloseEncryptedDocs<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 25
2<br />
PubSec Methods<br />
General PubSec Methods<br />
PSDataBufferDigest<br />
ASBool PSDataBufferDigest (PSDataBuffer dataBuffer,<br />
ASUns8* digestValue, DSDigestMethod digestMethod);<br />
Description<br />
Computes the digest for a set of data. A handler will use this call to make PubSec compute<br />
the digest for a data buffer when signing or verifying signatures. This method calls<br />
PSDataBufferEnum to get the bytes and computes an MD5 or SHA-1 digest.<br />
Parameters<br />
dataBuffer<br />
digestValue<br />
digestMethod<br />
The buffer containing the data.<br />
(Filled by the method) A pointer to the digest value. The buffer<br />
must large enough for the requested digest method:<br />
● For an MD5 digest, it must be at least 16 bytes.<br />
● For an SHA-1 digest, it must be at least 20 bytes.<br />
The method to use to compute the digest.<br />
Return Value<br />
true if successful, false otherwise.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSDataBufferEnum<br />
26 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Methods<br />
General PubSec Methods<br />
2<br />
PSDataBufferEnum<br />
ASBool PSDataBufferEnum (PSDataBuffer dataBuffer,<br />
ASInt32 maxSize, ASUns8 **pReturnBuffer,<br />
ASInt32 *pReturnSize);<br />
Description<br />
Gets bytes of data to digest when signing or verifying, in chunks of a specified size.<br />
Continues getting data chunks until all of the data in the data buffer has been returned.<br />
A handler will use this call when computing its own data digest, to get the next blob of<br />
bytes to digest. The dataBuffer object keeps track of the bytes that have been returned,<br />
of how many bytes remain to be returned, and of the byte ranges of data to be provided.<br />
When signing or verifying a PDDoc, the data buffer object is a PDDoc handle and the bytes<br />
returned will be those defined by /ByteRange in the signature object dictionary. See the PDF<br />
<strong>Reference</strong> for details.<br />
The PSDataBufferDigest uses this method when computing the digest for the data.<br />
Parameters<br />
dataBuffer<br />
maxSize<br />
pReturnBuffer<br />
pReturnSize<br />
The buffer containing the data.<br />
The maximum number of bytes to return in the return buffer.<br />
(Filled by the method) A pointer to the buffer containing the<br />
current bytes to be processed. If NULL, an error occurred and you<br />
should abort the enumeration.<br />
(Filled by the method) A pointer to the size in bytes of the return<br />
buffer. When 0, do not process the return buffer, but continue<br />
enumerating until the method returns false. Always less than<br />
maxSize.<br />
Return Value<br />
true as long as there is more data to process, false when the end of the buffer is<br />
reached.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSDataBufferDigest<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 27
2<br />
PubSec Methods<br />
General PubSec Methods<br />
PSExportDataExchange<br />
ASBool PSExportDataExchange<br />
(PSExportDataExchangeParams params);<br />
Description<br />
Exports certificates, requests for certificates, and so on, to FDF files or other file types, using<br />
a UI wizard interface. Includes support to export to a file or to email.<br />
The specified type of data is exported to a file and optionally emailed to a destination that<br />
is chosen using the wizard.<br />
● If the data is saved to a file and is the user's own contact information, it can be a PKCS#7<br />
file (.p7c).<br />
● If the data contains just one certificate and is saved to a file, it can be a raw certificate file<br />
(.cer).<br />
● Otherwise, it is always an FDF file.<br />
Does not raise or throw. Displays an alert if unsuccessful.<br />
Parameters<br />
params<br />
A structure containing the export parameters.<br />
Return Value<br />
true if successful, false otherwise.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSImportDataExchange<br />
28 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Methods<br />
General PubSec Methods<br />
2<br />
PSImportDataExchange<br />
ASBool PSImportDataExchange<br />
(PSImportDataExchangeParams params);<br />
Description<br />
Imports FDF data from a file, using a UI wizard interface. The parameters structure specifies<br />
the type and location of the data. This call is used, for example, by the Directory<br />
configuration dialog to import directory settings from an FDF file.<br />
When you use this call (rather than opening the FDF file directly) the PubSec FDF handling<br />
code is used, which provided support for FDF signature verification. PubSec opens the FDF<br />
file, then calls the handler’s PSImportDataProc, using the handler and engine specified<br />
in the parameters structure.<br />
The operation fails if the data is not of the specified type. Does not raise or throw. Displays<br />
an alert if unsuccessful.<br />
Parameters<br />
params<br />
A structure containing the import parameters.<br />
Return Value<br />
true if successful, false otherwise.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSExportDataExchange<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 29
2<br />
PubSec Methods<br />
General PubSec Methods<br />
PSRegisterHandler<br />
ASBool PSRegisterHandler (ExtensionID owner,<br />
PubSecHandler psHandler);<br />
Description<br />
Registers a handler with the PubSec HFT. The caller retains ownership of the<br />
PubSecHandlerRec.<br />
Parameters<br />
owner<br />
psHandler<br />
The handler’s plug-in ExtensionID, assigned at initialization.<br />
The handler structure containing the handler methods to register.<br />
Return Value<br />
true if successful, false otherwise.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSUnregisterHandler<br />
30 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Methods<br />
General PubSec Methods<br />
2<br />
PSSigValidatePDDocSigField<br />
ASBool*PSSigValidatePDDocSigField<br />
(PSSigPDDocParams docParams);<br />
Description<br />
Validates a specified signature field in a PDDoc. For example, you might call this from the<br />
validate button of a signature properties dialog, or if any information used during<br />
validation is changed. Does not bring up any UI.<br />
A return value of true indicates that the validation operation was successfully peformed,<br />
but does not provide any information about the result of the validation (that is, the<br />
signature’s validity value). The method does not return validity information, but simply<br />
updates the DigSig and PubSec validation caches.<br />
N OTE:<br />
This method cannot validate a signature whose cache has not been updated or is<br />
NULL. In this case, use the method DigSigVerifySig.<br />
Parameters<br />
docParams<br />
The validation parameters.<br />
Return Value<br />
true if the validation was successfully performed, false otherwise.<br />
Header File<br />
PubSecHFT.h<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 31
2<br />
PubSec Methods<br />
General PubSec Methods<br />
PSUnregisterHandler<br />
ASBool PSUnegisterHandler (PubSecHandler psHandler);<br />
Description<br />
Unregisters a handler from the PubSec HFT. This does not destroy the handler; the caller<br />
owns the PubSecHandlerRec.<br />
Parameters<br />
psHandler<br />
The handler to unregister.<br />
Return Value<br />
true if successful, false otherwise.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSRegisterHandler<br />
32 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Methods<br />
PubSec <strong>Acrobat</strong> Address Book Methods<br />
2<br />
PubSec <strong>Acrobat</strong> Address Book Methods<br />
These methods allow you to manage certificates in the <strong>Acrobat</strong> Address Book (AAB).<br />
AABFindCertsByName<br />
void AABFindCertsByName (const ASUns8* inCertNameData,<br />
ASInt32 inCertNameSize, ASCab outResults);<br />
Description<br />
Does a lookup in the <strong>Acrobat</strong> Address Book by certificate subject name. Returns all<br />
certificates that match the name along with trust information associated with them.<br />
The returned ASCab contains:<br />
● An entry for each certificate, with a 0-based index followed by the X509 certificate as<br />
ASN1-encoded binary data<br />
● An entry with a key Tn containing the associated trust value of each certificate, where n<br />
corresponds to the certificate’s index key.<br />
If a trust key is missing, the value should be assumed to be untrusted. For example:<br />
{ ("0", cert1), ("1", cert2), ("T1", kPSSigTrustAuthenticDocuments) }<br />
In this case, cert1 is untrusted, cert2 is trusted for authentic documents.<br />
Parameters<br />
inCertNameData<br />
inCertNameSize<br />
outResults<br />
The subject name of the certificates to find. Specify a BERencoded<br />
value of ASN.1 type Name defined in X.509 (RFC 3280).<br />
The size of the certificate subject name data.<br />
(Filled by the method) An ASCab containing any certificates found<br />
by the lookup and their trust information.<br />
Return Value<br />
true if successful, false otherwise.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
AABGetCertTrust<br />
AABGetTrustedCerts<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 33
2<br />
PubSec Methods<br />
PubSec <strong>Acrobat</strong> Address Book Methods<br />
AABGetCertChain<br />
ASBool AABGetCertChain (const ASUns8* inX509Cert,<br />
ASInt32 inX509CertSize, ASCab inTrustedCerts,<br />
ASCab inUntrustedCerts, ASCab outChain);<br />
Description<br />
Finds the certificate chain for the specified certificate in the <strong>Acrobat</strong> Address Book.<br />
A certificate ASCab contains an entry for each certificate,with a 0-based index followed by<br />
the X509 certificate as ASN1-encoded binary data; for example:<br />
Parameters<br />
{ ("0", cert1), ("1", cert2), ... }<br />
inX509Cert<br />
inX509CertSize<br />
inTrustedCerts<br />
inUntrustedCerts<br />
outChain<br />
The certificate identifier, as defined in X.509 (RFC 3280). This is<br />
a generic 8-bit pointer to the certificate data.<br />
The size in bytes of the X.509 certificate pointed to by<br />
inX509Cert.<br />
An ASCab containing the user’s trusted certificates.<br />
An ASCab containing additional certificates needed to build<br />
the certificate chain.<br />
(Filled by the method) An ASCab containing the certificate<br />
chain. The specified certificate itself is at index 0, followed by<br />
the chain certificates in issuing order.<br />
Return Value<br />
true if successful, false otherwise.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
AABGetTrustedCerts<br />
34 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Methods<br />
PubSec <strong>Acrobat</strong> Address Book Methods<br />
2<br />
AABGetCertTrust<br />
PSSigTrust AABGetCertTrust (const ASUns8* inX509Cert,<br />
ASInt32 inX509CertSize, ASCab inCertChain,<br />
ASCab inHelperCerts);<br />
Description<br />
Finds the specified certificate in the <strong>Acrobat</strong> Address Book and returns the trust level.<br />
Parameters<br />
inX509Cert<br />
inX509CertSize<br />
inCertChain<br />
inHelperCerts<br />
The certificate identifier, as defined in X.509 (RFC 3280). This is a<br />
generic 8-bit pointer to the certificate data.<br />
The size in bytes of the X.509 certificate pointed to by<br />
inX509Cert.<br />
An ASCab containing the certificate chain for the certificate,<br />
with the trust level for each certificate. It starts with<br />
inX509Cert's issuer at index 0 and continues in the issuing<br />
order. Can be NULL if the chain is not available.<br />
An ASCab containing an unordered sequence of certificates that<br />
can be used to build the certificate chain. If inCertChain is<br />
NULL and inX509Cert is not self-signed, PubSec attempts to<br />
build a chain of certificates using a default mechanism.<br />
A certificate ASCab contains an entry for each certificate,with a<br />
0-based index followed by the X509 certificate as ASN1-encoded<br />
binary data; for example:<br />
{ ("0", cert1), ("1", cert2), ... }<br />
Return Value<br />
The trust value for the specified certificate, if found. If no certificate is found, returns<br />
kPSSigTrustUntrusted. To distinguish a certificate that is not found from one whose<br />
trust level is reported as untrusted, use AABIsCertPresent.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
AABGetTrustedCerts<br />
AABIsCertPresent<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 35
2<br />
PubSec Methods<br />
PubSec <strong>Acrobat</strong> Address Book Methods<br />
AABGetTrustedCerts<br />
void AABGetTrustedCerts (PSSigTrust inTrust,<br />
ASCab outResults);<br />
Description<br />
Finds the certificates with a specified level of trust in the <strong>Acrobat</strong> Address Book.<br />
Parameters<br />
inTrust<br />
outResults<br />
The level of trust for which to find certificates. A logical OR of<br />
PSSigTrust bit flags.<br />
(Filled by the method) An ASCab containing the trusted certificates<br />
found in the AAB.<br />
A certificate ASCab contains an entry for each certificate,with a 0-<br />
based index followed by the X509 certificate as ASN1-encoded<br />
binary data; for example:<br />
{ ("0", cert1), ("1", cert2), ... }<br />
Return Value<br />
true if successful, false otherwise.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
AABGetCertTrust<br />
36 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Methods<br />
PubSec <strong>Acrobat</strong> Address Book Methods<br />
2<br />
AABIsCertPresent<br />
ASBool AABIsCertPresent (const ASUns8* x509, ASInt32 size);<br />
Description<br />
Finds the specified certificate in the <strong>Acrobat</strong> Address Book. Use this method to distinguish a<br />
certificate that is not found by AABGetCertTrust from one whose trust level is reported<br />
as untrusted.<br />
Parameters<br />
x509 The certificate identifier, as defined in X.509 (RFC 3280).<br />
size The size of the certificate pointed to by x509.<br />
Return Value<br />
true if the certificate is found, false otherwise.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
AABGetCertTrust<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 37
2<br />
PubSec Methods<br />
<strong>Digital</strong> <strong>Signature</strong> Appearance File Methods<br />
<strong>Digital</strong> <strong>Signature</strong> Appearance File Methods<br />
These methods allow a handler to access the built-in <strong>API</strong>con appearance handler, through<br />
the DSAP file. This information is used to display a selection list of signature appearances.<br />
DSAPFileAcquire<br />
ASBool DSAPFileAcquire (const ASBool bResolveProblems,<br />
const ASBool bCreate<br />
Description<br />
Acquires the DSAP file and opens it, if it has not already been acquired.<br />
PubSec calls this method to access a file, so a handler does not need to acquire a DSAP file<br />
unless it needs to access it for other reasons.<br />
Parameters<br />
bResolveProblems<br />
bCreate<br />
When true, if there are problems trying to open the file,<br />
PubSec opens a UI that gives a user the option to delete the<br />
corrupted file.<br />
When true, if the file does not exist it is created. Normally<br />
true.<br />
Return Value<br />
true if the file was acquired and opened, false otherwise.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
DSAPFileRelease<br />
38 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Methods<br />
<strong>Digital</strong> <strong>Signature</strong> Appearance File Methods<br />
2<br />
DSAPFileCanDeleteNthEntry<br />
ASBool DSAPFileCanDeleteNthEntry (const ASInt32 index);<br />
Description<br />
Tests whether a signature appearance entry at a specified index in the DSAP file can be<br />
edited or is read-only.<br />
Parameters<br />
index<br />
The position of the entry to test. The first entry is at index 0. A negative value<br />
gets the default entry.<br />
Return Value<br />
true if the entry is editable, false otherwise.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
DSAPFileGetCount<br />
DSAPFileRemoveNthEntry<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 39
2<br />
PubSec Methods<br />
<strong>Digital</strong> <strong>Signature</strong> Appearance File Methods<br />
DSAPFileCopyNthEntry<br />
ASBool DSAPFileCopyNthEntry (const ASInt32 index);<br />
Description<br />
Creates a copy of the specified entry in the default DSAP file and appends the copy to the<br />
end of the list of signature appearances in the file.<br />
When you copy a default appearance entry, the copy is not considered a default<br />
appearance entry.<br />
Parameters<br />
index<br />
The position of the entry to copy. The first entry is at index 0. A negative value<br />
gets the default entry.<br />
Return Value<br />
true if the copy was successful and the appearance file was successfully edited and saved,<br />
false otherwise.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
DSAPFileCanDeleteNthEntry<br />
DSAPFileEditNthEntry<br />
40 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Methods<br />
<strong>Digital</strong> <strong>Signature</strong> Appearance File Methods<br />
2<br />
DSAPFileEditNthEntry<br />
ASBool DSAPFileEditNthEntry (const APPreview previewData,<br />
const ASInt32 index);<br />
Description<br />
Opens the UI that allows the user to edit the specified signature appearance entry of the<br />
DSAP file.<br />
Parameters<br />
previewData<br />
index<br />
Data with which to create a signature preview in the edit dialog.<br />
The position of the entry to edit. The first entry is at index 0. A<br />
negative value gets the default entry. An index larger than the<br />
current number of entries creates a new entry.<br />
Return Value<br />
true if successful (the changes to the entry were made and saved), false otherwise.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
DSAPFileCanDeleteNthEntry<br />
DSAPFileCopyNthEntry<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 41
2<br />
PubSec Methods<br />
<strong>Digital</strong> <strong>Signature</strong> Appearance File Methods<br />
DSAPFileGetCount<br />
ASInt32 DSAPFileGetCount (void)<br />
Description<br />
Gets the number of configured signature appearance entries in the DSAP file,<br />
Parameters<br />
None<br />
Return Value<br />
The number of configured AP entries.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
DSAPFileCanDeleteNthEntry<br />
42 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Methods<br />
<strong>Digital</strong> <strong>Signature</strong> Appearance File Methods<br />
2<br />
DSAPFileGetNewNthName<br />
ASText DSAPFileGetNewNthName (const ASInt32 index);<br />
Description<br />
Gets a copy of the name of the specified signature appearance entry in the DSAP file. Use<br />
this when building a list of signatures for a user to choose from or edit.<br />
Parameters<br />
index<br />
The position of the entry whose name to obtain. The first entry is at index 0. A<br />
negative value gets the default entry.<br />
Return Value<br />
A copy of the name as an ASText object.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
DSAPFileGetCount<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 43
2<br />
PubSec Methods<br />
<strong>Digital</strong> <strong>Signature</strong> Appearance File Methods<br />
DSAPFileRelease<br />
void DSAPFileRelease (void);<br />
Description<br />
Closes the digital signature appearance (DSAP) file.<br />
Parameters<br />
None<br />
Return Value<br />
None<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
DSAPFileAcquire<br />
DSAPFileSave<br />
44 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Methods<br />
<strong>Digital</strong> <strong>Signature</strong> Appearance File Methods<br />
2<br />
DSAPFileRemoveNthEntry<br />
ASBool DSAPFileRemoveNthEntry (const ASInt32 index);<br />
Description<br />
Deletes the specified signature appearance entry from the DSAP file.<br />
Parameters<br />
index<br />
The position of the entry to remove. The first entry is at index 0. A negative<br />
value gets the default entry.<br />
Return Value<br />
true if successful, false otherwise.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
DSAPFileCanDeleteNthEntry<br />
DSAPFileGetCount<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 45
2<br />
PubSec Methods<br />
<strong>Digital</strong> <strong>Signature</strong> Appearance File Methods<br />
DSAPFileSave<br />
void DSAPFileSave (void);<br />
Description<br />
Saves the DSAP file if it is dirty, leaving it open.<br />
Parameters<br />
None<br />
Return Value<br />
None<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
DSAPFileRelease<br />
46 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Methods<br />
<strong>Digital</strong> <strong>Signature</strong> Appearance File Methods<br />
2<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 47
2<br />
PubSec Methods<br />
<strong>Digital</strong> <strong>Signature</strong> Appearance File Methods<br />
48 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
3<br />
PubSec Callbacks<br />
PSDestroyEngineProc<br />
ACCB1 void (ACCB2 *PSDestroyEngineProc)<br />
(PubSecEngine engine);<br />
Description<br />
Destroys a public key security engine for this handler, freeing the memory.<br />
Parameters<br />
engine<br />
The engine to be destroyed.<br />
Return Value<br />
None<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSNewEngineProc<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 49
3<br />
PubSec Callbacks<br />
PSExportDataProc<br />
ACCB1 DSRetCode (ACCB2 *PSExportDataProc)<br />
(PubSecEngine engine, PSExportDataType dataType,<br />
ASCab outCab, ASBool bInUIAllowed);<br />
Description<br />
This function gets data of the specified type from a handler, to be exported to an FDF or<br />
CMS file and possibly sent as an email attachment. The function is called when exporting<br />
to FDF, for example, in response to an FDF Data Exchange certificate request.<br />
<strong>Acrobat</strong> calls PSGetBoolPropertyProc to see if the relevant data type is supported in<br />
the handler implementation. See PSExportDataType.<br />
Parameters<br />
engine<br />
dataType<br />
outCab<br />
bInUIAllowed<br />
The engine for which the data is exported.<br />
The type of data to be exported.<br />
The ASCab containing the data to be exported.<br />
When true, the call can invoke the UI to export the data.<br />
Return Value<br />
Positive on success.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSImportDataProc<br />
50 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Callbacks<br />
3<br />
PSGetAtomPropertyProc<br />
ACCB1 ASAtom (ACCB2 *PSGetAtomPropertyProc)<br />
(PubSecEngine engine, const char* szPropertyName);<br />
Description<br />
Gets an ASAtom property of an engine. (For a list of public properties of a<br />
PubSecEngine, see PubSecHFT.h.)<br />
Parameters<br />
engine<br />
szPropertyName<br />
The engine for which the property value is obtained.<br />
The name of the ASAtom property whose value is obtained.<br />
Return Value<br />
The ASAtom property value, or ASAtomNull if the property value is not set.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSGetBoolPropertyProc<br />
PSGetInt32PropertyProc<br />
PSGetTextPropertyProc<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 51
3<br />
PubSec Callbacks<br />
PSGetBoolPropertyProc<br />
ACCB1 ASBool (ACCB2 *PSGetBoolPropertyProc)<br />
(PubSecEngine engine, const char* szPropertyName,<br />
const ASBool defaultValue);<br />
Description<br />
Gets an ASBool property of an engine. (For a list of public properties of a<br />
PubSecEngine, see PubSecHFT.h.)<br />
Parameters<br />
engine<br />
szPropertyName<br />
defaultValue<br />
The engine for which the property value is obtained.<br />
The name of the ASBool property whose value is obtained.<br />
The value to return if the property value is not set.<br />
Return Value<br />
The boolean property value, or the specified default value if the property value is not set.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSGetAtomPropertyProc<br />
PSGetInt32PropertyProc<br />
PSGetTextPropertyProc<br />
52 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Callbacks<br />
3<br />
PSGetDirHandlerInfo<br />
ACCB1 DSRetCode (ACCB2 *PSGetDirHandlerInfo)<br />
(PubSecEngine engine, DirHandlerInfo outDirHandlerInfo);<br />
Description<br />
Gets information about directory handlers in an engine that is acting as a directory service<br />
provider.<br />
Parameters<br />
engine<br />
outDirHandlerInfo<br />
The engine for which the information is obtained.<br />
(Filled by the method) A structure containing an array of<br />
ASCab directory handlers.<br />
Return Value<br />
Positive on success.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSGetDirInfo<br />
PSGetDirList<br />
PSOpenConnection<br />
PSSetDirInfo<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 53
3<br />
PubSec Callbacks<br />
PSGetDirInfo<br />
ACCB1 DSRetCode (ACCB2 *PSGetDirInfo)<br />
(PubSecEngine engine, ASAtom inDirID,<br />
DirectoryInfo outDirInfo);<br />
Description<br />
Gets information about directories in an engine that is acting as a directory service<br />
provider.<br />
Parameters<br />
engine<br />
inDirID<br />
outDirInfo<br />
The engine for which the information is obtained.<br />
The unique identifier associated with the directory. See<br />
DirHandlerInfo.<br />
(Filled by the method) An ASCab containing information about the<br />
directory.<br />
Return Value<br />
Positive on success.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSGetDirHandlerInfo<br />
PSGetDirList<br />
PSOpenConnection<br />
PSSetDirInfo<br />
54 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Callbacks<br />
3<br />
PSGetDirList<br />
ACCB1 DSRetCode (ACCB2 *PSGetDirList)<br />
(PubSecEngine engine, DirectoryList outDirList);<br />
Description<br />
Gets a list of directories in an engine that is acting as a directory service provider.<br />
Parameters<br />
engine<br />
outDirList<br />
The engine for which the information is obtained.<br />
(Filled by the method) An ASCab containing an array of<br />
DirectoryInfo ASCab objects.<br />
Return Value<br />
Positive on success.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSGetDirHandlerInfo<br />
PSGetDirInfo<br />
PSOpenConnection<br />
PSSetDirInfo<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 55
3<br />
PubSec Callbacks<br />
PSGetImplicitRecipientsProc<br />
ACCB1 DSRetCode (ACCB2 *PSGetDirHandlerInfo)<br />
(PubSecEngine engine, DirHandlerInfo outDirHandlerInfo);<br />
Description<br />
Gets information about directory handlers in an engine that is acting as a directory service<br />
provider.<br />
Parameters<br />
engine<br />
outDirHandlerInfo<br />
The engine for which the information is obtained.<br />
(Filled by the method) An ASCab containing an array of<br />
ASCab directory handlers.<br />
Return Value<br />
Positive on success.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSGetDirInfo<br />
PSGetDirList<br />
PSSetDirInfo<br />
56 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Callbacks<br />
3<br />
PSGetInt32PropertyProc<br />
ACCB1 ASInt32 (ACCB2 *PSGetInt32PropertyProc)<br />
(PubSecEngine engine, const char* szPropertyName,<br />
const ASInt32 defaultValue);<br />
Description<br />
Gets an ASInt32 property of an engine. (For a list of public properties of a<br />
PubSecEngine, see PubSecHFT.h.)<br />
Parameters<br />
engine<br />
szPropertyName<br />
defaultValue<br />
The engine for which the property value is obtained.<br />
The name of the ASInt32 property whose value is obtained.<br />
The value to return if the property value is not set.<br />
Return Value<br />
The ASInt32 property value, or the specified default value if the property value is not set.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSGetAtomPropertyProc<br />
PSGetBoolPropertyProc<br />
PSGetTextPropertyProc<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 57
3<br />
PubSec Callbacks<br />
PSGetLogoProc<br />
ACCB1 void (ACCBPROTO2 *PSGetLogoProc)<br />
(ASAtom label, const char* *pcLogo,<br />
const ASFixedRect* *pRect);<br />
Description<br />
Gets custom artwork from the handler, to be used as a label for a particular validity state.<br />
The artwork for standard labels does not need to be specifically retrieved. If you are not<br />
using dynamic signature appearances or not using custom artwork, the handler need only<br />
handle the null-label case.<br />
Parameters<br />
label<br />
pcLogo<br />
pRect<br />
A validity state, as returned by PSSigValGetAPLabelProc, for<br />
which to use this logo. If ASAtomNull, the logo is used as an<br />
invariable watermark of the signature appearance.<br />
(Filled by the method) A string of the uncompressed graphics stream<br />
for the logo artwork.<br />
(Filled by the method) The precise bounding box that the artwork<br />
occupies.<br />
Return Value<br />
None<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSSigCreateAPNXObjProc<br />
PSSigValGetAPLabelProc<br />
58 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Callbacks<br />
3<br />
PSGetTextPropertyProc<br />
ACCB1 ASText (ACCB2 *PSGetTextPropertyProc)<br />
(PubSecEngine engine, const char* szPropertyName,<br />
const ASInt32 index);<br />
Description<br />
Gets an ASText property of an engine. (For a list of public properties of a<br />
PubSecEngine, see PubSecHFT.h.)<br />
For the PROP_PSENG_Exception property, index is a DSRetCode value. If a handler<br />
receives a a call to get PROP_PSENG_Exception, it must reset its exception status so<br />
that subsequent calls to get an exception string return NULL.<br />
NULL return values are legal for all properties.<br />
Parameters<br />
engine<br />
szPropertyName<br />
index<br />
The engine for which the property value is obtained.<br />
The name of the ASText property whose value is obtained.<br />
The index of the string to obtain if the property contains a list of<br />
values. If it does not, index is ignored.<br />
Return Value<br />
The ASText property value, or NULL if the property value is not set.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSGetAtomPropertyProc<br />
PSGetBoolPropertyProc<br />
PSGetInt32PropertyProc<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 59
3<br />
PubSec Callbacks<br />
PSImportDataProc<br />
ACCB1 DSRetCode (ACCB2 *PSImportDataProc)<br />
(PubSecEngine engine, PSImportDataParams params,<br />
ASBool bInUIAllowed);<br />
Description<br />
This function sends data of a particular type to a handler to import into its own data store.<br />
This is call is executed in response to data received, for example, through an FDF file or<br />
through the signature dictionary.<br />
<strong>Acrobat</strong> calls PSGetBoolPropertyProc to see if the relevant data type is supported in<br />
the handler implementation. See PSImportDataType.<br />
Parameters<br />
engine<br />
params<br />
bInUIAllowed<br />
The engine for which the data is exported.<br />
A structure that contains the data to be imported.<br />
When true, the call can invoke the user-interface dialogs if needed.<br />
Return Value<br />
Positive on success.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSExportDataProc<br />
60 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Callbacks<br />
3<br />
PSNewEngineProc<br />
ACCB1 PubSecEngine (ACCB2 *PSNewEngineProc) ( );<br />
Description<br />
Creates a new public key security engine for this handler, not associated with any UI.<br />
Parameters<br />
None.<br />
Return Value<br />
The new engine.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSDestroyEngineProc<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 61
3<br />
PubSec Callbacks<br />
PSOpenCMSEnvelopeProc<br />
ACCB1 DSRetCode (ACCB2 *PSOpenCMSEnvelopeProc)<br />
(PubSecEngine engine, PSOpenCMSEnvelopeParams params,<br />
ASBool bInUIAllowed );<br />
Description<br />
This procedure is required. Called to open the provided PKCS#7 cryptographic message<br />
service (CMS) enveloped data object and return the data contained in it.<br />
Parameters<br />
engine<br />
params<br />
bInUIAllowed<br />
The engine for which the data is exported.<br />
A structure containing the envelope data and fields for the<br />
handler to return opened envelope data contents, and<br />
optionally the session key and opening certificate.<br />
When true, the call can invoke the UI for anything required<br />
to open the envelope. For instance, a login may be needed<br />
to access the user's private key.<br />
Return Value<br />
kDSTrue if the envelope was opened, kDSFalse if the envelope could not be opened, or<br />
an error code in case of error.<br />
Header File<br />
PubSecHFT.h<br />
62 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Callbacks<br />
3<br />
PSOpenConnection<br />
ACCBPROTO1 DSRetCode (ACCBPROTO2 *PSOpenConnection)<br />
(PubSecEngine engine, ASAtom inDirID,<br />
DirAuthenticationContext inAuthCtx, ASBool inUI,<br />
DirConnection* pOutConnection);<br />
Description<br />
Opens a connection to a specified directory to use for authentication.<br />
Parameters<br />
engine<br />
inDirID<br />
inAuthCtx<br />
inUI<br />
pOutConnection<br />
The engine for which the connection is opened.<br />
The identifier for the directory to which the connection is opened.<br />
Not currently supported. Pass as NULL.<br />
Whether the authentication UI should be shown.<br />
(Filled by the method) A pointer to the new connection object.<br />
Return Value<br />
kDSTrue if the connection is opened, or kDSFalse if it is not.<br />
Header File<br />
PubSecHFT.h<br />
Related Callbacks<br />
PSGetDirHandlerInfo<br />
PSGetDirInfo<br />
PSGetDirList<br />
PSSetDirInfo<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 63
3<br />
PubSec Callbacks<br />
PSPerformOperationProc<br />
ACCB1 DSRetCode (ACCB2 *PSPerformOperationProc)<br />
(PubSecEngine engine, PSPerformOpType type,<br />
const ASCab cab, ASBool bUI);<br />
Description<br />
Performs the specified operation using parameters contained in cab. This interface is used<br />
by EScript.<br />
Parameters<br />
engine<br />
type<br />
cab<br />
bUI<br />
The engine for which the operation is performed.<br />
The type of operation to perform.<br />
An ASCab containing parameters for the requested operation, or<br />
NULL to test whether the operation is supported.<br />
When true, the call can invoke the user-interface dialogs if needed.<br />
Return Value<br />
If cab is NULL, returns kDSTrue if the operation is supported, or kDSFalse if it is not.<br />
If cab contains data, returns kDSOk if the operation is successful, an exception code if not.<br />
Header File<br />
PubSecHFT.h<br />
64 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Callbacks<br />
3<br />
PSSessionAcquireProc<br />
ACCB1 DSRetCode (ACCB2 *PSSessionAcquireProc)<br />
(PubSecEngine engine, PDDoc pdDoc, PSSessionOpType opType,<br />
ASText opText, ASCab cabParams, ASBool bUIAllowed);<br />
Description<br />
Called to acquire resources that will be needed to begin a PubSec session. For example, it<br />
might need to log on before performing a desired operation. If resources are already<br />
available, the handler may not need to do anything.<br />
When the function completes successfully, PubSec calls PSSessionReleaseProc with<br />
the same operation type. Multiple calls can be made to acquire the same or different<br />
operation types, before a previously acquired resource is released. Handlers should keep a<br />
reference count if required for a particular resource.<br />
Despite the name, this function does not acquire a session, just the resources that will be<br />
needed by the session. For example, to begin a signing session, PubSec calls<br />
PSSessionAcquire with kPSOpTypePDDocSign. The PubSec handler should select<br />
the resources and credentials that are to be used for signing. If the call is successfull, PubSec<br />
will proceed with the PSSigGetSigPropertiesProc and<br />
PSSigGetSigValueProc calls.<br />
Parameters<br />
engine<br />
pdDoc<br />
opType<br />
opText<br />
cabParams<br />
bUIAllowed<br />
The engine for which the information is obtained.<br />
The PDF document for which the session is acquired.<br />
The operation that is the reason for acquiring the session.<br />
A human-readable version of the reason for acquiring the session. If<br />
not supplied, opType is used to build text.<br />
An ASCab object containing information about the acquisition,<br />
owned by PubSec. Currently not used, passed as NULL.<br />
When true, the call can invoke the user-interface dialogs if needed.<br />
Return Value<br />
Positive on success.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSSessionReadyProc<br />
PSSessionReleaseProc<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 65
3<br />
PubSec Callbacks<br />
PSSessionReadyProc<br />
ACCB1 DSRetCode (ACCB2 *PSSessionReadyProc)<br />
(PubSecEngine engine, PSSessionOpType opType);<br />
Description<br />
Returns kDSTrue if the resources and information needed to perform the specified<br />
operation have been acquired.<br />
Parameters<br />
engine<br />
opType<br />
The engine for which the information is obtained.<br />
The operation for which the session is needed.<br />
Return Value<br />
kDSTrue if the session is ready, otherwise kDSFalse.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSSessionAcquireProc<br />
PSSessionReleaseProc<br />
66 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Callbacks<br />
3<br />
PSSessionReleaseProc<br />
ACCB1 DSRetCode (ACCB2 *PSSessionReleaseProc)<br />
(PubSecEngine engine, PSSessionOpType opType);<br />
Description<br />
Releases any resources that were required for the specified operation, such as file handles.<br />
It is up to a handler to decide what resources to release. A handler can, for example, leave a<br />
user logged on, even after a session is released.<br />
This call can fail. For example, you might want the call to fail if the operation is<br />
kPSOpTypeEScriptLogin and encrypted documents are open.<br />
Parameters<br />
engine<br />
opType<br />
The engine for which the session was acquired.<br />
The operation for which the session was needed.<br />
Return Value<br />
kDSTrue if the session is successfully released, otherwise kDSFalse.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSSessionAcquireProc<br />
PSSessionReadyProc<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 67
3<br />
PubSec Callbacks<br />
PSSetDirInfo<br />
ACCB1 DSRetCode (ACCB2 *PSSetDirInfo)<br />
(PubSecEngine engine, DirectoryInfo inDirInfo);<br />
Description<br />
Sets information about a directory in an engine that is acting as a directory service provider.<br />
Parameters<br />
engine<br />
inDirInfo<br />
The engine for which the information is obtained.<br />
An ASCab containing information about the directory.<br />
● If the PROP_DirectoryInfo_ID value matches one of the<br />
existing directories, that directory's information is overwritten.<br />
● If it does not match any existing directory, a new directory is<br />
created.<br />
Return Value<br />
kDSOk if successful, otherwise an exception code.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSGetDirHandlerInfo<br />
PSGetDirInfo<br />
PSGetDirList<br />
PSOpenConnection<br />
68 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Callbacks<br />
3<br />
PSSigAuthenticateProc<br />
ACCB1 DSRetCode (ACCB2 *PSSigAuthenticateProc)<br />
(PubSecEngine engine, const PDDoc pdDoc, ASCab inESParams,<br />
ASBool bInUIAllowed);<br />
Description<br />
Called to authenticate the signer. The caller can determine whether authentication is<br />
required by calling PSGetBoolPropertyProc with the property<br />
PROP_PSENG_IsAuthenticated.<br />
This procedure is called only if specified by the PSSigSigPropParams passed to<br />
PSSigGetSigPropertiesProc. If your handler does not need this call, it should be<br />
defined to always return kDSTrue.<br />
Parameters<br />
engine<br />
pdDoc<br />
inESparams<br />
bInUIAllowed<br />
The engine for which signature authentication is performed.<br />
A PDF document for window parenting. NULL if there is no PDDoc.<br />
Optional. An ASCab containing authentication parameters. If not<br />
supplied or if authentication fails, and if bInUIAllowed is true,<br />
brings up the authentication UI to obtain parameters.<br />
When true, the call can invoke the authentication UI.<br />
Return Value<br />
kDSTrue if authentication succeeds, kDSFalse if authentication fails.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSGetBoolPropertyProc<br />
PSSigGetSigValueProc<br />
PSSigValidateProc<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 69
3<br />
PubSec Callbacks<br />
PSSigCreateAPNXObjProc<br />
ACCB1 DSRetCode (ACCB2 *PSSigCreateAPNXObjProc)<br />
(PubSecEngine engine, CosObj *pOutXObj,<br />
PSSigPDDocParams docParams, PSAPSigType sigType);<br />
Description<br />
Creates the signature appearance that is put into the /AP dictionary /N entry.<br />
It is recommended that you set this procedure to NULL, w hich allows PubSec to use the<br />
default APHandler to generate the XObj for the appearance.<br />
Parameters<br />
engine<br />
pOutXObj<br />
docParams<br />
sigType<br />
The engine for which an appearance is created.<br />
(Filled by the method) The XObject to use for the signature appearance.<br />
A validation parameters structure containing information that is<br />
needed to create the signature appearance, such as the PDDoc and<br />
annotation.<br />
The signature type.<br />
Return Value<br />
kDSOk if successful, otherwise an exception code.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSGetLogoProc<br />
PSSigValGetAPLabelProc<br />
70 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Callbacks<br />
3<br />
PSSigGetSigPropertiesProc<br />
ACCB1 DSRetCode (ACCB2 *PSSigGetSigPropertiesProc)<br />
(PubSecEngine engine, PSSigSigPropParams params);<br />
Description<br />
Called when creating a new signature. For PDDoc signatures, this call replaces SigNew<br />
and SigCommit calls. It returns the values that PubSec writes into the signature dictionary<br />
in the parameters structure.<br />
Before making this call, the handler should use PSSessionAcquireProc to choose the<br />
credential to be used for signing.<br />
The handler can use the UI during this call to allow authentication and to bring up the<br />
signing dialog.<br />
Parameters<br />
engine<br />
params<br />
The engine for which signature properties are retrieved.<br />
A signature properties parameters structure.<br />
Return Value<br />
kDSOk if successful, otherwise an exception code.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSGetLogoProc<br />
PSSessionAcquireProc<br />
PSSigValGetAPLabelProc<br />
PSSigGetSigValueProc<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 71
3<br />
PubSec Callbacks<br />
PSSigGetSigValueProc<br />
ACCB1 DSRetCode (ACCB2 *PSSigGetSigValueProc)<br />
(PubSecEngine engine,<br />
PSSigGetSigValueParams inOutParams);<br />
Description<br />
Called to sign the digest and return the signature value. The memory for the signature<br />
value becomes the property of the caller.<br />
When called for a PKCS #7 signature, there is a "size-only" option: if the value of<br />
pOutSigValueData in the inOutParams structure is NULL, returns the expected size<br />
of the signature value.<br />
For most values of digestMethod in the inOutParams structure, the digest is passed<br />
into the handler, and the handler needs to sign it. However if a handler specifies that it must<br />
do its own digest ( for example, for the legacy EntrustFile toolkit) then a NULL digest is<br />
passed in. The handler can specify this using<br />
PROP_PSENG_SignFormatPKCS7Digest. If and only if this property is true, the digest<br />
is not passed to the handler.<br />
This procedure should not show any user interface and not allow a user to cancel the<br />
signing operation.<br />
Parameters<br />
engine<br />
params<br />
The engine for which a signature value is created.<br />
(Modified by the method) A structure containing signature-value<br />
parameters and return values.<br />
Return Value<br />
kDSOk if successful, otherwise an exception code.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSSigAuthenticateProc<br />
PSSigGetSigPropertiesProc<br />
PSSigValidateProc<br />
72 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Callbacks<br />
3<br />
PSSigPropDialogProc<br />
ACCB1 DSRetCode (ACCB2 *PSSigPropDialogProc)<br />
(PubSecEngine engine,<br />
PSSigValidateDialogParams valParams);<br />
Description<br />
Called to show a dialog that shows signature properties.<br />
If this procedure is NULL (which is recommended), PubSec opens its own properties dialog.<br />
The default properties dialog includes buttons that allow the user to import and to display<br />
certificates:<br />
● The import button calls PSImportDataProc.<br />
● If the handler implements the kPSOpPerformDisplayCertList operation (see<br />
PSPerformOperationProc) the show-certificate button can open the handlerprovided<br />
display dialog. Otherwise, the button opens the default certificate-display<br />
dialog.<br />
Parameters<br />
engine<br />
valParams<br />
The engine for which the validation status is shown.<br />
(Modified by the method) A properties-dialog parameters and return<br />
values structure. The handler can set the dsPropType to<br />
kSDPropViewVersion to request rollback to this signature when<br />
the dialog is closed.<br />
Return Value<br />
kDSOk if successful, otherwise an exception code.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSSigValidateDialogProc<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 73
3<br />
PubSec Callbacks<br />
PSSigValGetAPLabelProc<br />
ACCB1 ASAtom (ACCB2 *PSSigValGetAPLabelProc)<br />
(ASCab valCab, const ASInt32 layerNum);<br />
Description<br />
Called to get a name to use for a particular layer of signature appearance. This is used when<br />
the signature appearance uses the n1 and n3 layers for dynamic signature appearances.<br />
Beginning in <strong>Acrobat</strong> 6.0, <strong>Acrobat</strong> is discouraging the use of dynamic signature<br />
appearances and is instead showing the signature validity as an icon that is rendered at run<br />
time.<br />
Provide this prededure for handlers that need to be backward compatible with earlier<br />
implementations that use custom artwork. The procedure can be set to NULL when not<br />
using dynamic signature appearances.<br />
If the value DSAPValid, DSAPDoubleValid, or DS<strong>API</strong>nvalid is returned, <strong>Acrobat</strong><br />
uses standard labels. Otherwise <strong>Acrobat</strong> calls PSGetLogoProc to return logo artwork to<br />
use for the XObject. A return value of ASAtomNull causes <strong>Acrobat</strong> to use a blank XObject<br />
for the specified layer.<br />
Parameters<br />
valCab<br />
layerNum<br />
An ASCab containing the signature validation result for which the<br />
label is obtained.<br />
The layer for which a label is obtained.<br />
Return Value<br />
The label of a signature appearance layer as an ASAtom.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSGetLogoProc<br />
PSSigCreateAPNXObjProc<br />
74 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Callbacks<br />
3<br />
PSSigValGetTextProc<br />
ACCB1 ASText (ACCB2 *PSSigValGetTextProc)<br />
(ASCab valCab, const DSSigValText textType,<br />
const ASInt32 index );<br />
Description<br />
Called to get the text result of validation. For most values of textType, the handler should<br />
return NULL, causing PubSec to use the default text strings ("Valid," "Invalid," or "Unknown,"<br />
depending on the validity state). Handlers will normally need to provide their own ID<br />
validity strings.<br />
Parameters<br />
valCab<br />
textType<br />
index<br />
The ASCab containing the validation result. (See<br />
PSSigValidateParams.)<br />
The type of result text to obtain, for a specific context.<br />
If the type is kDSSigValTextAP, the corresponding index value.<br />
Otherwise ignored.<br />
Return Value<br />
The text result of validation as a new ASText object.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSSigValidateProc<br />
PSSigValidateDialogProc<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 75
3<br />
PubSec Callbacks<br />
PSSigValidateDialogProc<br />
ACCB1 DSRetCode (ACCB2 *PSSigValidateDialogProc)<br />
(PubSecEngine engine,<br />
PSSigValidateDialogParams valParams);<br />
Description<br />
Called to show a dialog that shows validation status, after the signature is validated.<br />
If this procedure is NULL (which is recommended), PubSec opens its own validation dialog.<br />
Parameters<br />
engine<br />
valParams<br />
The engine for which the validation status is shown.<br />
A validation dialog parameters structure. The validation state<br />
resulting from the previous validation operation is passed in the<br />
sigValCab field.<br />
The handler can update the dsPropType field if the properties<br />
dialog should be opened next.<br />
Return Value<br />
kDSOk if successful, otherwise an exception code.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSSigAuthenticateProc<br />
PSSigGetSigValueProc<br />
PSSigPropDialogProc<br />
PSSigValidateProc<br />
PSSigValidateSupportedProc<br />
76 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Callbacks<br />
3<br />
PSSigValidateProc<br />
ACCB1 DSRetCode (ACCB2 *PSSigValidateProc)<br />
(PubSecEngine engine, PSSigValidateParams params )<br />
Description<br />
Called to validate a signature.<br />
Parameters<br />
engine<br />
params<br />
The engine for which the signature is validated.<br />
(Modified by the method) A signature validation parameters and return<br />
values structure. The result of validation is stored in the sigValCab<br />
field.<br />
Return Value<br />
kDSOk if successful, otherwise an exception code.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSSigAuthenticateProc<br />
PSSigGetSigValueProc<br />
PSSigValidateDialogProc<br />
PSSigValidateSupportedProc<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 77
3<br />
PubSec Callbacks<br />
PSSigValidateSupportedProc<br />
ACCB1 PSSigValSupport (ACCB2 *PSSigValidateSupportedProc)<br />
(PubSecEngine engine, PSSigValidateSupportParams params )<br />
Description<br />
Called to determine whether the handler can validate a signature.<br />
Parameters<br />
engine<br />
params<br />
The engine for which the signature is validated.<br />
A parameters structure containing information about the signature to<br />
be validated.<br />
Return Value<br />
A signature-validation support value.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSSigAuthenticateProc<br />
PSSigGetSigValueProc<br />
PSSigValidateDialogProc<br />
PSSigValidateProc<br />
78 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
4<br />
PubSec Declarations<br />
These data structures and declarations are used by the PubSec methods.<br />
APPreview<br />
typedef struct _t_APPreviewRec {<br />
const char* logo;<br />
ASFixedRect* logoBBox;<br />
ASText fName;<br />
ASText fDN;<br />
ASText fReason;<br />
ASText fLocation;<br />
ASFixed fWidth;<br />
ASFixed fHeight;<br />
bool fbAuthSig;<br />
} APPreviewRec, *APPreview;<br />
Description<br />
Data with which to build a signature preview in the edit dialog for a signature appearance<br />
file entry.<br />
Members<br />
logo<br />
logoBBox<br />
fName<br />
fDN<br />
fReason<br />
fLocation<br />
fWidth<br />
fHeight<br />
fbAuthSig<br />
The logo string.<br />
The bounding box for the logo string.<br />
The entry name.<br />
The distinguished name.<br />
The reason for signing.<br />
The location of signing.<br />
The width and height that determine the aspect ratio of the preview<br />
image.<br />
true if this is an author signature, false otherwise.<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 79
4<br />
PubSec Declarations<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
DSAPFileEditNthEntry<br />
80 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Declarations<br />
4<br />
DirAuthenticationContext<br />
typedef ASCab DirAuthenticationContext;<br />
Description<br />
An ASCab object containing authentication details such as the user name and password. It<br />
could be used to override the default authentication entries, or to avoid repeated<br />
authentications in case the context could be cached. The actual contents depend on the<br />
directory handlers. The currently supported directory handlers (AAB and LDAP) do not<br />
support this feature.<br />
Header File<br />
PubSecHFT.h<br />
Related Callbacks<br />
PSOpenConnection<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 81
4<br />
PubSec Declarations<br />
DirConnection<br />
typedef struct _t_DirConnection* DirConnection;<br />
Description<br />
A directory connection object, defined in the <strong>Acrobat</strong> Directory Services.<br />
Header File<br />
DirectoryHFT.h<br />
Related Callbacks<br />
PSOpenConnection<br />
82 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Declarations<br />
4<br />
DirectoryInfo<br />
typedef ASCab DirectoryInfo;<br />
Description<br />
A directory information ASCab that contains a UI name as an ASText and a unique id as<br />
an ASAtom.<br />
A directory information structure contains configuration settings used to establish a<br />
connection to a directory, including a UI name and unique identifier. It contains standard<br />
entries that use the prefix dirStdEntry, and can also contain other configuration<br />
information specific to a directory.<br />
Common top-level properties are:<br />
Property Type Description<br />
dirStdEntryName ASText (Required) Name of this directory<br />
for display; for example, "<strong>Adobe</strong><br />
Employees".<br />
dirStdEntryID ASAtom (Required) Unique identifier for<br />
the directory. For example:<br />
<strong>Adobe</strong>.PPKMS.LDAP.dir0.<br />
dirStdEntryPrefDirHandlerID ASAtom (Optional) Languageindependent<br />
name of the<br />
directory handler to be used<br />
when connecting to this<br />
directory; for example,<br />
<strong>Adobe</strong>.PPKMS.ADSI.<br />
Required when there are multiple<br />
directory handlers within a DSP.<br />
dirStdEntryDirType ASAtom (Optional) Languageindependent<br />
name for the type<br />
of the directory; for example,<br />
LDAP.<br />
Required when entries are to be<br />
imported or exported.<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 83
4<br />
PubSec Declarations<br />
Header File<br />
Property Type Description<br />
dirStdEntryVersion ASInt32 (Optional) The version of the<br />
directory. It is currently<br />
0x00010000 for all the directory<br />
types currently supported(ADSI,<br />
AAB), indicating that this is the<br />
first revision of that structure. The<br />
version number will be<br />
incremented as the structure<br />
changes.<br />
DirectoryHFT.h<br />
Related Callbacks<br />
PSGetDirInfo<br />
PSGetDirHandlerInfo<br />
84 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Declarations<br />
4<br />
DirectoryList<br />
typedef ASCab DirectoryList;<br />
Description<br />
A directory information list ASCab contains a vector of nested DirectoryInfo ASCabs,<br />
one for every directory contained within the engine. Each directory ASCab contains a UI<br />
name as an ASText and a unique id as an ASAtom.<br />
Header File<br />
PubSecHFT.h<br />
Related Callbacks<br />
PSGetDirList<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 85
4<br />
PubSec Declarations<br />
DirectoryInfo<br />
typedef ASCab DirHandlerInfo;<br />
Description<br />
A directory handler information ASCab contains a vector of nested ASCabs, one for every<br />
directory handler contained within the engine. Each directory handler ASCab contains a UI<br />
name and a unique identifier; for example, <strong>Adobe</strong>.PPKMS.LDAP. The key names for the<br />
properties are:<br />
PROP_DirHandlerInfo_Name ASText Required. UI name for the handler.<br />
PROP_DirHandlerInfo_ID ASAtom Required. Unique identifier for the<br />
directory handler. The handler is<br />
rejected if the ASAtom conflicts with<br />
one already registered.<br />
Header File<br />
PubSecHFT.h<br />
Related Callbacks<br />
PSGetDirHandlerInfo<br />
86 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Declarations<br />
4<br />
DirHandlerInfo<br />
typedef ASCab DirHandlerInfo;<br />
Description<br />
A directory handler information ASCab contains a vector of nested ASCabs, one for every<br />
directory handler contained within the engine. Each directory handler ASCab contains a UI<br />
name and a unique id; for example, "<strong>Adobe</strong>.PPKMS.LDAP". The key names for the properties<br />
are:<br />
PROP_DirHandlerInfo_Name ASText Required. UI name for the handler.<br />
PROP_DirHandlerInfo_ID ASAtom Required. Unique identifier for the<br />
directory handler. The handler is<br />
rejected if the ASAtom conflicts with<br />
one already registered.<br />
Header File<br />
PubSecHFT.h<br />
Related Callbacks<br />
PSGetDirHandlerInfo<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 87
4<br />
PubSec Declarations<br />
DSAPFile<br />
typedef struct C<strong>API</strong>conFile *DSAPFile;<br />
Description<br />
A signature appearance file object to be used by handlers to access the built-in <strong>API</strong>con<br />
appearance handler.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
DSAPFileAcquire<br />
88 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Declarations<br />
4<br />
DSDigestMethod<br />
typedef enum {<br />
kDSDigestNone=0,<br />
kDSDigestMD5,<br />
kDSDigestSHA1,<br />
kDSDigestEnumSize<br />
} DSDigestMethod;<br />
Description<br />
Constants that specify the method to use for creating a signature digest.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
PSDataBufferDigest<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 89
4<br />
PubSec Declarations<br />
DSPropertyType<br />
typedef enum {<br />
kDSPropNone=0,<br />
kDSProp<strong>Signature</strong>,<br />
kDSPropLegal,<br />
kDSPropViewVersion,<br />
kDSPropTypeEnumSize<br />
} DSPropertyType;<br />
Description<br />
Constants that specify what dialog to show.<br />
Values<br />
kDSPropNone<br />
kDSProp<strong>Signature</strong><br />
kDSPropLegal<br />
kDSPropViewVersion<br />
Do not show signature properties dialog.<br />
Show general signature properties dialog.<br />
Show legal notice dialog.<br />
Show signature rollback (will actually rollback to this<br />
signature).<br />
Header File<br />
DigSigHFT.h<br />
Related Structures<br />
PSSigValidateDialogParams<br />
Related Callbacks<br />
PSSigValidateDialogProc<br />
90 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Declarations<br />
4<br />
DSRetCode<br />
typedef ASInt32 DSRetCode;<br />
Description<br />
A return value code for PubSec callback methods. All negative return values are considered<br />
exceptions.<br />
Values<br />
kDSException (-2)<br />
kDSParameterError (-1)<br />
kDSFalse (0)<br />
kDSTrue (1)<br />
kDSOk (1)<br />
Get exception string. When this is returned,<br />
exception text should be available from the called<br />
routine. If the exception text is NULL, it is<br />
considered to be an unknown error.<br />
Error in a parameter to the function call. No<br />
exception string.<br />
A boolean return value.<br />
Success.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
numerous<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 91
4<br />
PubSec Declarations<br />
DSSaveType<br />
typedef enum {<br />
DSSignCancel=0,<br />
DSSignSave,<br />
DSSignSaveAs,<br />
DSSaveTypeEnumSize<br />
} DSSaveType;<br />
Description<br />
A return type for DigSig and PubSec callback.<br />
Values<br />
DSSignCancel<br />
DSSignSave<br />
DSSignSaveAs<br />
Do not proceed with signing.<br />
Save over old file.<br />
Save to new file.<br />
Header File<br />
DigSigHFT.h<br />
Related Callbacks<br />
PSSigGetSigPropertiesProc<br />
DSNewSigDataWithParamsProc<br />
92 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Declarations<br />
4<br />
DSSigValText<br />
typedef enum {<br />
kDSSigValTextNull,<br />
kDSSigValTextDSTop,<br />
kDSSigValTextDSDetail,<br />
kDSSigValTextDSTooltip,<br />
kDSSigValTextSigInfo,<br />
kDSSigValTextVal,<br />
kDSSigValTextProp,<br />
kDSSigValTextAP,<br />
kDSSigValTextPropIdValidity,<br />
kDSSigValTextDSAVIdValidity,<br />
kDSSigValTextDSTTIdValidity,<br />
kDSSigValTextEnumSize<br />
} DSSigValText;<br />
Description<br />
Types of text requested by PSSigValGetTextProc for a signature-validity ASCab<br />
object. The strings are generated by the handler, usually on the fly, when requested. A<br />
handler can cache the values in the sigVal ASCab (<strong>Acrobat</strong> plug-ins do not do this).<br />
PubSec copies values for DSTop, DSDetail, DSDetails and DSTooltip to the<br />
signature-propeties ASCab.<br />
● For optional entries, returning NULL causes PubSec to generate the values.<br />
● Depending on the context, one of the *IdValidity entries is required to specify the<br />
signer identity validity.<br />
Values<br />
kDSSigValTextNull<br />
kDSSigValTextDSTop<br />
kDSSigValTextDSDetail<br />
kDSSigValTextDSTooltip<br />
kDSSigValTextSigInfo<br />
kDSSigValTextVal<br />
Never called, should return NULL.<br />
Optional. Get text to show in AVPanel,<br />
added to end of signature summary line.<br />
Optional. Get text to show in AVPanel,<br />
shown in signature detail title line.<br />
Optional. Get text to show in tooltip when<br />
mouse is over signature annotation.<br />
Optional. Get text to show in EScript<br />
<strong>Signature</strong>Info object.<br />
Optional. Get text to show in validate alert<br />
dialog.<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 93
4<br />
PubSec Declarations<br />
kDSSigValTextProp<br />
kDSSigValTextAP<br />
kDSSigValTextPropIdValidity<br />
kDSSigValTextDSAVIdValidity<br />
kDSSigValTextDSTTIdValidity<br />
Optional. Get text to show in signature<br />
properties dialog.<br />
Optional. Get text to show in appearance, if<br />
signature appearance uses layer n4 (not<br />
recommended). In this case, you must also<br />
pass an index.<br />
Get text to describe validity of the signer<br />
certificate (used in properties and validity<br />
dialogs).<br />
Get text to describe validity of the signer<br />
certificate (used in AVPanel).<br />
Get text to describe validity of the signer<br />
certificate (appended to tooltip, called only<br />
when describing why certificate is invalid).<br />
Header File<br />
PubSecHFT.h<br />
Related Callbacks<br />
PSSigValGetTextProc<br />
94 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Declarations<br />
4<br />
PSAPSigType<br />
typedef enum {<br />
kPSAPSigPreExists=0,<br />
kPSAPSigTentative,<br />
kPSAPSigPreview<br />
} PSAPSigType;<br />
Description<br />
A signature type to use for generating a signature appearance.<br />
Values<br />
kPSAPSigPreExists<br />
kPSAPSigTentative<br />
kPSAPSigPreview<br />
Signing a pre-existing signature field.<br />
Creating a signature on the fly on a page.<br />
Creating a preview of a signature.<br />
Header File<br />
PubSecHFT.h<br />
Related Callbacks<br />
PSSigCreateAPNXObjProc<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 95
4<br />
PubSec Declarations<br />
PSDataBuffer<br />
typedef struct _s_PSDataBufferRec PSDataBufferRec,<br />
*PSDataBuffer;<br />
Description<br />
A buffer of data to be hashed when signing or verifying signatures. The buffer contains the<br />
bytes to be signed (by ByteRange) when signing a PDF file.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSDataBufferDigest<br />
PSDataBufferEnum<br />
96 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Declarations<br />
4<br />
PSExportDataExchangeParams<br />
typedef struct _t_PSExportDataExchangeParamsRec {<br />
ASSize_t size;<br />
PubSecHandler psHandler;<br />
PubSecEngine psEngine;<br />
PSExportDataType dataType;<br />
ASCab dataCab;<br />
PSExportDataType requestType;<br />
PSExportDestType destType;<br />
} PSExportDataExchangeParamsRec, *PSExportDataExchangeParams;<br />
Description<br />
Parameters for exporting data from PubSec to a file.<br />
Members<br />
size<br />
psHandler<br />
psEngine<br />
dataType<br />
dataCab<br />
requestType<br />
The size of the structure.<br />
If exporting FDF, the handler to use to sign the FDF. If not supplied,<br />
the user is prompted for a handler<br />
If exporting FDF, the engine to use to sign the FDF. If not supplied, the<br />
method uses the default (UI) engine.<br />
Type of data to be exported. One of:<br />
● kPSExportDataNone: Not specified.<br />
● kPSExportDataMyContact: Export the user's own contact<br />
information (certificates for encryption and/or signing).<br />
● kPSExportDataContacts: Export a list of contacts from an<br />
address book or directory that are to be shared.<br />
● kPSExportDataDirSettings : Export list of directory<br />
settings that can be used to help someone else configure their<br />
directory.<br />
Required. Data to export, or an empty ASCab if there is no data to<br />
export. Format defined below.<br />
The type of data to be requested. If supplied, the method adds a<br />
request to the FDF for this data type and forces the export format to<br />
be FDF. Same possible values as dataType.<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 97
4<br />
PubSec Declarations<br />
destType<br />
The destination type that specifies how data should be delivered.<br />
One of:<br />
● kPSExportDestNone: Not specified, prompt the user<br />
(recommended)<br />
● kPSExportDestFile: Save as unspecified file type, possibly<br />
prompting for the file type.<br />
● kPSExportDestCMSFile: Save as CMS file.<br />
● kPSExportDestFDFFile: Save as FDF file.<br />
● kPSExportDestEMailFDF: Save a email FDF file.<br />
● kPSExportDestCertURL: Send single certificate to URL.<br />
The dataCab Format<br />
A top level ASCab contains lists of PROP_ExportDataCab_Contacts,<br />
PROP_ExportDataCab_DirSettings or whatever other data is to be included. This<br />
top level cab can include entries for an EMail address (used as the return email address) and<br />
cn. It is recommended that the cn entry be set to the common name of the user; this will be<br />
used only in creating the filename for the FDF (or PKCS#7) file. If either of cn or EMail<br />
address are not provided they are fetched from the AVIdentity preference settings.<br />
Contents of the individual list entries are added as CosDicts to the FDF file after adding a<br />
/Type attribute and changing /Certs entries into /CMS entries (because the FDF format<br />
supports only CMS). Refer to the FDF Data Exchange specification for details of attributes.<br />
● Each contact can include an email address and a list of certificates (as /Certs entries or as<br />
CMS objects).<br />
● Each directory entry contains directory-specific information that can be converted to a<br />
CosDict before storing in the FDF file. File entries give cDIPaths to files that are to<br />
be embedded.<br />
Example cab for exporting a contact:<br />
dataCab : Cab<br />
"Contacts" : Cab<br />
"0" : Cab<br />
"EMail" : "jsmith@smithcorp.com"<br />
"Certs" : Cab<br />
"0" : binary end entity cert<br />
"cn" : "John Smith"<br />
"EMail" : "jsmith@smithcorp.com"<br />
Example cab for exporting directory settings:<br />
dataCab : Cab<br />
"DirSettings" : Cab<br />
"0" : Cab<br />
"Port" : 369<br />
Header File<br />
PubSecHFT.h<br />
98 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Declarations<br />
4<br />
Related Methods<br />
PSExportDataExchange<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 99
4<br />
PubSec Declarations<br />
PSExportDataType<br />
typedef enum {<br />
kPSExportDataNone=0,<br />
kPSExportDataMyContact,<br />
kPSExportDataContacts,<br />
kPSExportDataDirSettings,<br />
kPSExportDataEnumSize<br />
} PSExportDataType;<br />
Description<br />
The format of data to be exported using PSExportDataProc or<br />
PSExportDataExchange.<br />
Members<br />
kPSExportDataNone<br />
kPSExportDataMyContact<br />
kPSExportDataContacts<br />
kPSExportDataDirSettings<br />
kPSExportDataEnumSize<br />
None. No export operation is performed.<br />
Export certificates for self.<br />
This operation is performed only if the<br />
PROP_PSENG_ExportContact property is<br />
set, indicating that the handler supports this<br />
format.<br />
Export a list of entries from an address book.<br />
This operation is performed only if the<br />
PROP_PSENG_ExportContact property is<br />
set, indicating that the handler supports this<br />
format.<br />
Export a list of directory settings.<br />
This operation is performed only if the<br />
PROP_PSENG_ExportDirSettings<br />
property is set, indicating that the handler<br />
supports this format.<br />
The size of the enum<br />
Header File<br />
PubSecHFT.h<br />
Related Callbacks<br />
PSExportDataProc<br />
Related Methods<br />
PSExportDataExchange<br />
100 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Declarations<br />
4<br />
PSExportDestType<br />
typedef enum {<br />
kPSExportDestNone=0,<br />
kPSExportDestFile,<br />
kPSExportDestCMSFile,<br />
kPSExportDestCertFile,<br />
kPSExportDestFDFFile,<br />
kPSExportDestEMailFDF,<br />
kPSExportDestCertURL,<br />
kPSExportDestEnumSize<br />
} PSExportDestType;<br />
Description<br />
File output options for PSExportDataExchangeParams.<br />
Members<br />
kPSExportDestNone<br />
kPSExportDestFile<br />
kPSExportDestCMSFile<br />
kPSExportDestCertFile<br />
kPSExportDestFDFFile<br />
kPSExportDestEMailFile<br />
kPSExportDestCertURL<br />
None, prompt for output file type.<br />
Recommended.<br />
Save as unspecified file type, possibly<br />
prompting for the file type.<br />
Save as CMS file (.p7c).<br />
Save as Certificate file (.cer).<br />
Save as FDF file.<br />
Email FDF file.<br />
Send single certificate to URL.<br />
Header File<br />
PubSecHFT.h<br />
Related Callbacks<br />
PSExportDataProc<br />
Related Methods<br />
PSExportDataExchange<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 101
4<br />
PubSec Declarations<br />
PSImportDataExchangeParams<br />
typedef struct _t_PSImportDataExchangeParamsRec {<br />
ASSize_t size;<br />
PubSecHandler psHandler;<br />
PubSecEngine psEngine;<br />
PSExportDataType dataType;<br />
ASFileSys fileSys;<br />
ASPathName filePath;<br />
} PSImportDataExchangeParamsRec, *PSImportDataExchangeParams;<br />
Description<br />
Parameters for importing data from a file into PubSec.<br />
Members<br />
size<br />
psHandler<br />
psEngine<br />
dataType<br />
fileSys<br />
filePath<br />
The size of the structure.<br />
The handler to use to accept the import data, if it accepts the specified<br />
type.<br />
The engine to use to accept the import data. If not supplied, the method<br />
uses the default (UI) engine.<br />
The type of data to be imported. If data of this type is not found in the<br />
FDF, the operation fails. .<br />
The file system used for filePath.<br />
The path of the file to be opened for import.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSImportDataExchange<br />
102 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Declarations<br />
4<br />
PSImportDataParams<br />
typedef struct _t_PSImportDataParamsRec {<br />
ASSize_t size;<br />
PSImportDataType dataType;<br />
ASCab dataCab;<br />
PSSigTrust sigTrust;<br />
} PSImportDataParamsRec, *PSImportDataParams;<br />
Description<br />
Parameters for importing data from a file into PubSec; used in PSImportDataProc.<br />
Members<br />
size<br />
dataType<br />
The size of the structure.<br />
The format of the data to be imported.<br />
Header File<br />
dataCab ● If dataType is kPSImportDataSigDict, the signature<br />
dictionary.<br />
● If dataType is kPSImportDataFDFImportArray, the import<br />
array.<br />
● If dataType is kPSImportDataFDFDirArray, the directory<br />
settings array.<br />
sigTrust<br />
PubSecHFT.h<br />
Related Callbacks<br />
PSImportDataProc<br />
A flag that indicates whether this data comes from a trusted source.<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 103
4<br />
PubSec Declarations<br />
PSImportDataType<br />
typedef enum {<br />
kPSImportDataNone=0,<br />
kPSImportDataContactsCab,<br />
kPSImportDataContactsCabFromSig,<br />
kPSImportDataDirsCab,<br />
kPSImportDataEnumSize<br />
} PSImportDataType;<br />
Description<br />
The format of data to be imported using PSImportDataProc.<br />
The operation is only executed if the corresponding property (PROP_ImportContact or<br />
PROP_ImportDirSettings) is set, which indicates that the handler supports this<br />
format. If PROP_ImportContact is set, both of the corresponding formats must be<br />
supported.<br />
Members<br />
kPSImportDataNone<br />
kPSImportDataContactsCab<br />
kPSImportDataContactsCabFro<br />
mSig<br />
kPSImportDataDirsCab<br />
kPSImportDataEnumSize<br />
None. No import operation is performed.<br />
An ASCab containing a list ("0", "1", ...) of<br />
contact cabs. Contact cabs have the entries<br />
PROP_ContactCab_*.<br />
An ASCab containing a list ("0", "1", ...)<br />
containing a single contact cab. This Contact<br />
cab will have only the<br />
PROP_ContactCab_Certs entry set.<br />
This is sent only when trusting the signer of a<br />
signature.<br />
An ASCab containing a list ("0", "1", ...) of dir<br />
setting cabs. DirSetting cabs have the entries<br />
PROP_DirSettingCab_*..<br />
The size of this enum<br />
Header File<br />
PubSecHFT.h<br />
Related Callbacks<br />
PSImportDataProc<br />
104 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Declarations<br />
4<br />
PSOpenCMSEnvelopeParams<br />
Members<br />
typedef struct _t_PSOpenCMSEnvelopeParamsRec {<br />
ASSize_t size;<br />
const ASUns8* cmsEnvelopeData;<br />
ASUns32 cmsEnvelopeSize;<br />
ASUns8* outEnvelopeContentsData;<br />
ASUns32 outEnvelopeContentsSize;<br />
ASUns8* outSessionKeyData;<br />
ASUns32 outSessionKeySize;<br />
ASUns8* outOpeningCertData;<br />
ASUns32 outOpeningCertSize;<br />
} PSOpenCMSEnvelopeParamsRec, *PSOpenCMSEnvelopeParams;<br />
size<br />
cmsEnvelopeData<br />
cmsEnvelopeSize<br />
outEnvelopeContentsData<br />
outEnvelopeContentsSize<br />
outSessionKeyData<br />
outSessionKeySize<br />
outOpeningCertData<br />
outOpeningCertSize<br />
The size of this structure.<br />
Constant. The ASN1 encoded PKCS#7 Enveloped<br />
Data to open.<br />
Size in bytes of the data pointed to by<br />
cmsEnvelopeData.<br />
Returns the envelope contents data. PubSec<br />
owns, allocates and frees the memory.<br />
Size in bytes of the data pointed to by<br />
cmsEnvelopeContentsData.<br />
Optional. Returns the session key recovered<br />
when opening the envelope. If a session key is<br />
returned by the handler, PubSec uses it to open<br />
other recipient groups and enable the user to<br />
edit them.<br />
Size in bytes of the data pointed to by<br />
outSessionKeyData.<br />
Optional. The certificate corresponding to the<br />
private key used to open the envelope. When<br />
provided, PubSec displayes the name of the<br />
opener when the user edits the recipient list.<br />
Size in bytes of the data pointed to by<br />
outOpeningCertData.<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 105
4<br />
PubSec Declarations<br />
PSPerformOpType<br />
typedef enum {<br />
kPSOpPerformNone=0,<br />
kPSOpPerformESLogin,<br />
kPSOpPerformESLogout,<br />
kPSOpPerformESNewUser,<br />
kPSOpPerformESSetValidateMethod,<br />
kPSOpPerformESPasswordTimeout,<br />
kPSOpPerformDisplayCertList,<br />
kPSOpPerformGetCerts,<br />
kPSOpPerformEnumSize<br />
} PSPerformOpType;<br />
Description<br />
The type of operation to be performed by PSPerformOperationProc. The PubSec<br />
plug-in interprets relevant calls and dispatches them to handlers for the operation to be<br />
performed.<br />
Values<br />
kPSOpPerformNone<br />
kPSOpPerformESLogin<br />
kPSOpPerformESLogout<br />
kPSOpPerformESNewUser<br />
kPSOpPerformESSetValidateMethod<br />
kPSOpPerformESPasswordTimeout<br />
kPSOpPerformDisplayCertList<br />
kPSOpPerformGetCerts<br />
None<br />
Silent, scripted operations<br />
Brings up a UI to display a list of<br />
certificates contained in an ASCab.<br />
Returns true if implemented by the<br />
handler<br />
Returns a list of certificates in an ASCab.<br />
Header File<br />
PubSecHFT.h<br />
Related Callbacks<br />
PSPerformOperationProc<br />
106 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Declarations<br />
4<br />
PSSessionOpType<br />
typedef enum {<br />
kPSOpTypeNone=0,<br />
kPSOpTypePDDocSign,<br />
kPSOpTypePDDocSigValidate,<br />
kPSOpTypeCosDocSign,<br />
kPSOpTypeCosDocSigValidate,<br />
kPSOpTypeDataSign,<br />
kPSOpTypeDataSigValidate,<br />
kPSOpTypeMyContactExport,<br />
kPSOpTypeContactImport,<br />
kPSOpTypePolicyModify,<br />
kPSOpTypeAPRead,<br />
kPSOpTypePDCryptDocCreate,<br />
kPSOpTypePDCryptDocOpen,<br />
kPSOpTypeLogin,<br />
kPSOpTypeLogout,<br />
kPSOpTypeCertEnum,<br />
kPSOpTypeDirEnum,<br />
kPSOpTypeDirGet<br />
} PSSessionOpType;<br />
Description<br />
Operations for which a PubSec session can be acquired.<br />
Values<br />
kPSOpTypeNone<br />
kPSOpTypePDDocSign<br />
kPSOpTypePDDocSigValidate<br />
kPSOpTypeCosDocSign<br />
kPSOpTypeCosDocSigValidate<br />
kPSOpTypeDataSign<br />
kPSOpTypeDataSigValidate<br />
kPSOpTypeMyContactExport<br />
kPSOpTypeContactImport<br />
None<br />
Sign a PDDoc to create a PDDoc signature.<br />
Validate a PDDoc signature.<br />
Sign a cosDoc.<br />
Validate a cosDoc signature.<br />
Sign bytes.<br />
Validate bytes.<br />
Read and export My Contact information.<br />
Import contacts into address book.<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 107
4<br />
PubSec Declarations<br />
kPSOpTypePolicyModify<br />
kPSOpTypeAPRead<br />
kPSOpTypePDCryptDocCreate<br />
kPSOpTypePDCryptDocOpen<br />
kPSOpTypeLogin<br />
kPSOpTypeLogout<br />
kPSOpTypeCertEnum<br />
kPSOpTypeDirEnum<br />
kPSOpTypeDirGet<br />
Modify credential access policy (used by EScript).<br />
Read an appearance file (used by EScript).<br />
Prepare to encrypt docsuments.<br />
Prepare to open encrypted documents.<br />
Authenticate or login user (used by EScript).<br />
De-authenticate or logout user (used by EScript).<br />
Enumerate certificates available for signing and<br />
encryption.<br />
Enumerate directories and get directory<br />
information.<br />
Connect to and use directory.<br />
Header File<br />
PubSecHFT.h<br />
Related Callbacks<br />
PSSessionAcquireProc<br />
PSSessionReadyProc<br />
PSSessionReleaseProc<br />
108 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Declarations<br />
4<br />
PSSigCosDocParams<br />
typedef struct _t_PSSigCosDocParamsRec {<br />
ASSize_t size;<br />
PSSigDocType sigType;<br />
PDDoc pdDoc;<br />
CosDoc cosDoc;<br />
CosObj sigDict;<br />
} PSSigCosDocParamsRec, *PSSigCosDocParams;<br />
Description<br />
<strong>Signature</strong> parameters for a cosDoc. Used internally.<br />
Members<br />
size<br />
sigType<br />
pdDoc<br />
cosDoc<br />
sigDict<br />
The size of the structure.<br />
Constant. Always kPSSigDocTypeCosDoc.<br />
Constant. Null if no parent.<br />
Constant. The document being signed.<br />
Constant. The signature dictionary.<br />
Header File<br />
PubSecHFT.h<br />
Related Callbacks<br />
PSSigGetSigPropertiesProc<br />
Related Structures<br />
PSSigSigPropParams<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 109
4<br />
PubSec Declarations<br />
PSSigDataBufferParams<br />
typedef struct _t_PSSigDataBufferParamsRec {<br />
ASSize_t size;<br />
PSSigDocType sigType;<br />
PDDoc pdDoc;<br />
CosDoc cosDoc;<br />
} PSSigDataBufferParamsRec, *PSSigDataBufferParams;<br />
Description<br />
<strong>Signature</strong> parameters for signing transitional data, such as XFA.<br />
Members<br />
size<br />
sigType<br />
pdDoc<br />
cosDoc<br />
The size of the structure.<br />
Constant. Always kPSSigDocTypeCosDoc.<br />
Constant. NULL if no parent.<br />
Constant. The document being signed.<br />
Header File<br />
PubSecHFT.h<br />
Related Callbacks<br />
PSSigGetSigPropertiesProc<br />
Related Structures<br />
PSSigSigPropParams<br />
110 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Declarations<br />
4<br />
PSSigDocType<br />
typedef enum {<br />
kPSSigDocTypeNone=0,<br />
kPSSigDocTypePDDoc,<br />
kPSSigDocTypeCosDoc,<br />
kPSSigDocTypeTransData,<br />
kPSSigDocTypeEnumSize<br />
} PSSigDocType;<br />
Description<br />
The type of document being signed.<br />
Values<br />
kPSSigDocTypePDDoc<br />
kPSSigDocTypeCosDoc<br />
kPSSigDocTypeTransData<br />
A PDF document.<br />
An FDF file.<br />
Reserved for future use.<br />
Header File<br />
PubSecHFT.h<br />
Related Structures<br />
PSSigPDDocParams<br />
PSSigSigPropParams<br />
PSSigValidateDialogParams<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 111
4<br />
PubSec Declarations<br />
PSSigDialogStatus<br />
typedef enum {<br />
kPSSigDialogNone=0,<br />
kPSSigDialogSign,<br />
kPSSigDialogSignWithPassword,<br />
kPSSigDialogSignThenAuthenticate,<br />
kPSSigDialogStatusEnumSize<br />
} PSSigDialogStatus;<br />
Description<br />
Dialog information returned from PSSigGetSigPropertiesProc and other calls to<br />
tell PubSec what flow of subsequent dialogs or actions to execute. Not all values are legal<br />
for all calling procedures.<br />
Values<br />
kPSSigDialogNone<br />
kPSSigDialogSign<br />
kPSSigDialogSignWithPassword<br />
kPSSigDialogSignThenAuthenticate<br />
No further dialogs required.<br />
PubSec's sign dialog should be<br />
executed<br />
PubSec's sign dialog should be<br />
executed, and ask for password.<br />
PubSec's sign dialog should be<br />
executed, then SigAuthenticate<br />
should be called.<br />
Related Structures<br />
PSSigSigPropParams<br />
Related Callbacks<br />
PSSigGetSigPropertiesProc<br />
112 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Declarations<br />
4<br />
PSSigFileType<br />
typedef enum {<br />
kPSFileNone=0,<br />
kPSFileAVDoc,<br />
kPSFileBrowserDoc,<br />
kPSFileExternalDoc,<br />
kPSFileTempDoc,<br />
kPSFileFDFData,<br />
kPSFileCosDoc,<br />
kPSFileTransData,<br />
kPSFileEnumSize<br />
} PSSigFileType;<br />
Description<br />
A constant value that indicates the file type and environment in which data is being signed,<br />
used to set up buttons and text in the signing dialog.<br />
Values<br />
kPSFileNone<br />
kPSFileAVDoc<br />
kPSFileBrowserDoc<br />
kPSFileExternalDoc<br />
kPSFileTempDoc<br />
kPSFileFDFData<br />
kPSFileCosDoc<br />
kPSFileTransData<br />
Uninitialized.<br />
Normal PDDoc signing. Enable Save and SaveAs buttons<br />
Signing a PDDoc in an external browser window. Enable<br />
Sign button.<br />
Signing a PDDoc in an external non-browser window.<br />
Enable Sign button.<br />
Signing a temporary file. Enable SaveAs button<br />
Signing an FDF Data Exchange file. Enable Sign button.<br />
Signing a cosDoc. Enable Sign button.<br />
Signing transactional data.<br />
Header File<br />
PubSecHFT.h<br />
Related Structures<br />
PSSigSigPropParams<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 113
4<br />
PubSec Declarations<br />
PSSigMethod<br />
typedef enum {<br />
kPSSigMethodNone=0,<br />
kPSSigMethodPKCS1,<br />
kPSSigMethodPKCS7Detached,<br />
kPSSigMethodPKCS7SHA1,<br />
kPSSigMethodEnumSize<br />
} PSSigMethod;<br />
Description<br />
Constants that specify the method to use for creating a signature. For details, see the PDF<br />
<strong>Reference</strong>.<br />
Values<br />
kPSSigMethodNone<br />
kPSSigMethodPKCS1<br />
kPSSigMethodPKCS7Detached<br />
kPSSigMethodPKCS7SHA1<br />
None<br />
PKCS#1, adbe.x509.rsa.sha1<br />
adbe.pkcs7.detached<br />
adbe.pkcs7.sha1<br />
Header File<br />
PubSecHFT.h<br />
Related Structures<br />
PSSigGetSigValueParams<br />
Related Callbacks<br />
PSSigGetSigValueProc<br />
114 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Declarations<br />
4<br />
PSSigPDDocParams<br />
typedef struct _t_PSSigPDDocParamsRec {<br />
ASSize_t size;<br />
PSSigDocType sigType;<br />
PDDoc pdDoc;<br />
CosObj sigField;<br />
CosObj sigAnnot;<br />
ASFixed annotWidth;<br />
ASFixed annotHeight;<br />
ASCab sigAPCab;<br />
} PSSigPDDocParamsRec, *PSSigPDDocParams;<br />
Description<br />
Validation parameters for validating a document signature or specific signature field.<br />
Members<br />
size<br />
sigType<br />
pdDoc<br />
sigField<br />
sigAnnot<br />
annotWidth<br />
annotHeight<br />
sigAPCab<br />
The size of the structure.<br />
Constant. Always kPSSigDocTypePDDoc.<br />
Constant. The document being signed.<br />
Constant. The field being signed.<br />
Constant. The annotation associated with this field.<br />
Constant. Width of the annotion if the signature is visible.<br />
Constant. Height of the annotion if the signature is visible.<br />
Returns handler-specific appearance information for<br />
PSSigGetSigPropertiesProc.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSSigValidatePDDocSigField<br />
Related Callbacks<br />
PSSigGetSigPropertiesProc<br />
PSSigCreateAPNXObjProc<br />
Related Structures<br />
PSSigSigPropParams<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 115
4<br />
PubSec Declarations<br />
PSSigGetSigValueParams<br />
typedef struct _t_PSSigGetSigValueParamsRec {<br />
ASSize_t size;<br />
PSSigMethod sigMethod;<br />
DSDigestMethod digestMethod;<br />
const ASUns8* digestValue;<br />
PSDataBuffer dataBuffer;<br />
ASBool bGetSigValue;<br />
ASUns8* outSigValueData;<br />
ASUns32 outSigValueSize;<br />
ASCab outSigPropCab;<br />
} PSSigGetSigValueParamsRec, *PSSigGetSigValueParams;<br />
Description<br />
A structure containing parameters and return values for PSSigGetSigValueProc.<br />
Members<br />
size<br />
sigMethod<br />
digestMethod<br />
digestValue<br />
dataBuffer<br />
bGetSigValue<br />
outSigValueData<br />
outSigValueSize<br />
outSigPropCab<br />
The size of the structure.<br />
Constant. The method used to create the<br />
signature value.<br />
Constant. The method used to create the<br />
digest.<br />
Constant. A digest value to be signed or NULL.<br />
The handle to use for fetching bytes to digest.<br />
Constant. If true, get a signature value,<br />
otherwise return the size of the signature<br />
value.<br />
Return the signature value data. Caller will call<br />
ASfree to destroy the structure.<br />
Return size of the signature value.<br />
Return an ASCab containing signature<br />
properties that should be displayed instead of<br />
signature dictionary entries.<br />
Header File<br />
PubSecHFT.h<br />
116 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Declarations<br />
4<br />
Related Callbacks<br />
PSSigGetSigValueProc<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 117
4<br />
PubSec Declarations<br />
PSSigSigPropParams<br />
typedef struct _t_PSSigSigPropParamsRec {<br />
ASSize_t size;<br />
PDDoc pdDoc;<br />
PSSigFileType fileOptions;<br />
ASBool bUI;<br />
ASText dialogTitle;<br />
ASCab sigParamsCab;<br />
DSSaveType outSaveOptions;<br />
PSSigDialogStatus outDialogStatus;<br />
ASCab outCertListCab;<br />
ASCab outNewSigPropCab;<br />
ASCab outNewSigBuildCab;<br />
PSSigDocType docType;<br />
void* docParams;<br />
} PSSigSigPropParamsRec, *PSSigSigPropParams;<br />
Description<br />
A structure containing parameters and return values for<br />
PSSigGetSigPropertiesProc.<br />
Members<br />
size<br />
The size of the structure.<br />
pdDoc Constant. The pdDoc being signed. If not signing a pdDoc ,<br />
this is only used for window parenting and can be NULL.<br />
fileOptions<br />
bUI<br />
dialogTitle<br />
sigParamsCab<br />
outSaveOptions<br />
Constant. The file type and signing environment, which the<br />
handler uses to put up appropriate save buttons.<br />
Constant. When true , the call is being made from the UI,<br />
when false it is being made from a script or batch file.<br />
Title to use for the signing dialog, if bUI is true. Usually<br />
NULL, which allows the handler to use the default.<br />
Constant. Parameters passed in by EScript converted to an<br />
ASCab, or NULL if the call is not from EScript.<br />
If not providing your own sign dialog, set this value to<br />
DSSignSave.<br />
If providing your own sign dialog, return the result of your<br />
sign dialog. Setting the value to DSignCancel cancels the<br />
signing operation.<br />
118 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Declarations<br />
4<br />
outDialogStatus<br />
outCertListCab<br />
outNewSigPropCab<br />
outNewSigBuildCab<br />
docType<br />
docParams<br />
Return status information that tells PubSec what dialogs to<br />
put up and how to authenticate the handler.<br />
Required. Return an ASCab containing an ordered certificate<br />
chain, signing certificate first (at key 0).<br />
Required. Populate this existing ASCab with signature<br />
properties that will be written to the signature dictionary<br />
when the signature is committed.<br />
Optional. Populate this existing ASCab with return build<br />
properties that will be written to the signature dictionary<br />
when the signature is committed.<br />
Constant. The type of document being signed.<br />
A structure containing signature parameters appropriate to<br />
the type of document. Depending on sigType, a structure<br />
of type PSSigPDDocParams, PSSigCosDocParams, or<br />
PSSigDataBufferParams.<br />
Header File<br />
PubSecHFT.h<br />
Related Callbacks<br />
PSSigGetSigPropertiesProc<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 119
4<br />
PubSec Declarations<br />
PSSigTrust<br />
Description<br />
Bit flag constants that specify a level of trust for a certificate.<br />
Values<br />
kPSSigTrustUntrusted<br />
kPSSigTrustSigning<br />
kPSSigTrustAuthenticDocuments<br />
kPSSigTrustDynamicContent<br />
kPSSigTrustUbiquity<br />
kPSSigTrustJavaScript<br />
kPSSigTrustAll<br />
Certificate is untrusted.<br />
Trusted for signing (creating recipient<br />
signatures).<br />
Trusted for authoring documents (creating<br />
author signatures).<br />
Trusted for authoring documents with<br />
dyamic (multimedia) content.<br />
Trusted for feature-enabling signatures<br />
(<strong>Adobe</strong> internal use only).<br />
Trusted for authoring documents with fullaccess<br />
JavaScript.<br />
Trusted for everything.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
AABGetTrustedCerts<br />
Related Structures<br />
PSImportDataParams<br />
120 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Declarations<br />
4<br />
PSSigValidateParams<br />
typedef struct _t_PSSigValidateParamsRec {<br />
ASSize_t size;<br />
PSSigMethod sigMethod;<br />
DSDigestMethod digestMethod;<br />
ASUns8* digestValue;<br />
ASUns8* sigValueData;<br />
ASUns32 sigValueSize;<br />
ASCab certListCab;<br />
ASBool reqRevokeChecks;<br />
ASInt32 maxRevokeInfoCacheLifetime;<br />
ASCab sigValCab;<br />
ASCab outSigPropCab;<br />
PSDataBuffer dataBuffer;<br />
} PSSigValidateParamsRec, *PSSigValidateParams;<br />
Description<br />
A structure containing parameters and return values for PSSigValidateProc.<br />
Members<br />
size<br />
sigMethod<br />
digestMethod<br />
digestValue<br />
sigValueData<br />
sigValueSize<br />
certListCab<br />
The size of the structure.<br />
Constant. The method used to create the<br />
signature value.<br />
Constant. The method used to create the<br />
digest.<br />
Constant. A digest value to be signed or NULL.<br />
Constant. A signature value to be verified.<br />
Constant. The size of the signature value.<br />
In and out.<br />
● For a PKCS#1 signature, PubSec fills in the<br />
certificate chain.<br />
● For a PKCS#7 signature, PubSec returns an<br />
empty ASCab.<br />
For both signature types, the handler must<br />
provide the certificate chain that was validated.<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 121
4<br />
PubSec Declarations<br />
reqRevokeChecks<br />
maxRevokeInfoCacheLifetime<br />
sigValCab<br />
outSigPropCab<br />
dataBuffer<br />
Informs the handler whether revocation checks<br />
are required. Handlers should always do<br />
revocation checks, but return failure only when<br />
this value is true.<br />
The maximum life time (in minutes) of the<br />
cached information that is used for revocation<br />
checking. This is relevant for some types of<br />
revocation checking (such as CRL-based) and<br />
not for others (such as OCSP).<br />
Returns an ASCab containing the validity of<br />
the signature. Must not be NULL.<br />
The handler must set the values for<br />
PROP_SigVal_Id and<br />
PROP_SigVal_TrustFlags, and can<br />
optionally set PROP_SigVal_IdPriv. The<br />
handler should also set the value of<br />
PROP_SigVal_Digest if it is not already<br />
set. All other values should be left unmodified.<br />
Returns signature properties to display instead<br />
of signature dictionary entries.<br />
The handle to use for fetching bytes to digest.<br />
Header File<br />
PubSecHFT.h<br />
Related Callbacks<br />
PSSigValidateProc<br />
122 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Declarations<br />
4<br />
PSSigValidateDialogParams<br />
typedef struct _t_PSSigValidateDialogParamsRec {<br />
ASSize_t size;<br />
ASCab certListCab;<br />
ASBool reqRevokeChecks;<br />
ASInt32 maxRevokeInfoCacheLifetime;<br />
ASCab sigValCab;<br />
ASBool bModalParent;<br />
DSPropertyType dsPropType;<br />
PSSigDocType docType;<br />
void* docParams;<br />
} PSSigValidateDialogParamsRec, *PSSigValidateDialogParams;<br />
Description<br />
A structure containing parameters and return values for PSSigValidateDialogProc.<br />
Members<br />
size<br />
certListCab<br />
reqRevokeChecks<br />
maxRevokeInfoCacheLifetime<br />
sigValCab<br />
The size of the structure.<br />
In and out.<br />
● For a PKCS#1 signature, PubSec fills in the<br />
certificate chain.<br />
● For a PKCS#7 signature, PubSec returns an<br />
empty ASCab.<br />
For both signature types, the handler must<br />
provide the certificate chain that was validated.<br />
Informs the handler whether revocation checks<br />
are required. Handlers should always do<br />
revocation checks, but return failure only when<br />
this value is true.<br />
The maximum life time (in minutes) of the<br />
cached information that is used for revocation<br />
checking. This is relevant for some types of<br />
revocation checking (such as CRL-based) and<br />
not for others (such as OCSP).<br />
An ASCab containing the validity of the<br />
signature. Never NULL.<br />
The handler can validate the signature and<br />
update this object if desired.<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 123
4<br />
PubSec Declarations<br />
bModalParent<br />
dsPropType<br />
docType<br />
docParams<br />
Indicates whether being called when a modal<br />
parent dialog is open. If true, rollback and<br />
verify buttons should be disabled because<br />
i) rollback is not possible while modal parent is<br />
open; (ii) verify status may not get propagated<br />
properly to various caching locations.<br />
Returns a value that tells PubSec whether to<br />
rollback the signature or show a properties<br />
dialog for the signature.<br />
Constant. The type of document being signed.<br />
A structure containing signature parameters<br />
appropriate to the type of document.<br />
Depending on sigType, a structure of type<br />
PSSigPDDocParams or<br />
PSSigCosDocParams.<br />
Header File<br />
PubSecHFT.h<br />
Related Callbacks<br />
PSSigValidateDialogProc<br />
124 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Declarations<br />
4<br />
PSSigValidateSupportParams<br />
typedef struct _t_PSSigValidateSupportParamsRec {<br />
ASSize_t size;<br />
ASAtom filter;<br />
ASAtom subFilter;<br />
ASInt32 version;<br />
ASInt32 revision;<br />
ASCab buildCab;<br />
} PSSigValidateSupportParamsRec, *PSSigValidateSupportParams;<br />
Description<br />
A structure containing signature parameters for PSSigValidateSupportedProc.<br />
Members<br />
size<br />
filter<br />
subFilter<br />
version<br />
revision<br />
buildCab<br />
The size of the structure.<br />
Constant. The value of the /Filter attribute for the signature.<br />
Constant. The value of the /SubFilter attribute for the signature.<br />
Constant. The value of the /V attribute for the signature.<br />
Constant. The value of the /R attribute for the signature.<br />
Constant. The handler’s build properties dictionary, as an ASCab.<br />
Header File<br />
PubSecHFT.h<br />
Related Callbacks<br />
PSSigValidateSupportedProc<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 125
4<br />
PubSec Declarations<br />
PSSigValSupport<br />
typedef enum {<br />
kPSSigValSupportFalse,<br />
kPSSigValSupportTrue,<br />
kPSSigValSupportUpdate,<br />
kPSSigValSupportPreRelease,<br />
kPSSigValSupportEnumSize<br />
} PSSigValSupport;<br />
Description<br />
Constant values indicating how a handler supports validation for a particular signature.<br />
Values<br />
kPSSigValSupportFalse<br />
kPSSigValSupportTrue<br />
kPSSigValSupportUpdate<br />
kPSSigValSupportPreRelease<br />
The handler does not support validationof this<br />
signature.<br />
The handler supports validationof this<br />
signature.<br />
A handler software update is needed to<br />
support validation of this signature.<br />
The signature was created with a pre-release<br />
or invalid release of the software. Warns user.<br />
Header File<br />
PubSecHFT.h<br />
Related Callbacks<br />
PSSigValidateSupportedProc<br />
126 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Declarations<br />
4<br />
PubSecEngine<br />
typedef void* PubSecEngine;<br />
Description<br />
A PubSec engine object. There can be multiple engine objects per handler.<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSCloseEncryptedDocs<br />
PSCountEncryptedDocs<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 127
4<br />
PubSec Declarations<br />
PubSecHandler<br />
typedef struct _t_PubSecHandlerRec {<br />
ASSize_t size;<br />
_t_PubSecHandlerRec *next; /*used internally*/<br />
DigSigHandler dsHandler; /*used internally*/<br />
PDCryptHandler cryptHandler; /*used internally*/<br />
PubSecEngine engine;<br />
PSNewEngineProc newEngine;<br />
PSDestroyEngineProc destroyEngine;<br />
PSGetBoolPropertyProc getBoolProperty;<br />
PSGetAtomPropertyProc getAtomProperty;<br />
PSGetInt32PropertyProc getInt32Property;<br />
PSGetTextPropertyProc getTextProperty;<br />
PSSessionAcquireProc sessionAcquire;<br />
PSSessionReleaseProc sessionRelease;<br />
PSSessionReadyProc sessionReady;<br />
PSPerformOperationProc performOperation;<br />
PSSigGetSigPropertiesProc sigGetSigProperties;<br />
PSSigAuthenticateProc sigAuthenticate;<br />
PSSigGetSigValueProc sigGetSigValue;<br />
PSSigValidateProc sigValidate;<br />
PSSigValidateDialogProc sigValidateDialog;<br />
PSSigPropDialogProc sigPropDialog;<br />
PSSigValGetTextProc sigValGetText;<br />
PSGetLogoProc getLogo;<br />
PSSigValGetAPLabelProc sigValGetAPLabel;<br />
PSSigCreateAPNXObjProc sigCreateAPNXObj;<br />
PSImportDataProc importData;<br />
PSExportDataProc exportData;<br />
PSOpenCMSEnvelopeProc cryptOpenCMSEnvelope;<br />
PSGetImplicitRecipientsProc cryptGetImplicitRecipients;<br />
PSGetDirHandlerInfo dirGetDirHandlerInfo;<br />
PSGetDirList dirGetDirList;<br />
PSGetDirInfo dirGetDirInfo;<br />
PSSetDirInfo dirSetDirInfo;<br />
PSOpenConnection dirOpenConnection;<br />
} PubSecHandlerRec, *PubSecHandler;<br />
Description<br />
A handler structure that specifies the callbacks to register for a PubSec engine.<br />
Members<br />
size<br />
The size of the structure.<br />
128 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Declarations<br />
4<br />
next<br />
dsHandler<br />
cryptHandler<br />
engine<br />
newEngine<br />
destroyEngine<br />
getBoolProperty<br />
getAtomProperty<br />
getInt32Property<br />
getTextProperty<br />
sessionAcquire<br />
sessionRelease<br />
sessionReady<br />
performOperation<br />
sigGetSigProperties<br />
sigAuthenticate<br />
sigGetSigValue<br />
sigValidate<br />
sigValidateDialog<br />
sigPropDialog<br />
sigValGetText<br />
sigValGetText<br />
getLogo<br />
sigValGetAPLabel<br />
sigCreateAPNXObj<br />
importData<br />
exportData<br />
cryptOpenCMSEnvelope<br />
cryptGetImplicitRecipients<br />
dirGetDirHandlerInfo<br />
dirGetDirList<br />
dirGetDirInfo<br />
dirSetDirInfo<br />
dirOpenConnection<br />
Used internally.<br />
Engine to use for UI-based execution.<br />
Engine constructor and destructor.<br />
Property retrieval methods.<br />
Session operation methods.<br />
<strong>Signature</strong> methods.<br />
Validation methods<br />
<strong>Signature</strong> appearance methods.<br />
Contact exchange methods.<br />
Encryption methods.<br />
Directory Service Provider methods.<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 129
4<br />
PubSec Declarations<br />
Header File<br />
PubSecHFT.h<br />
Related Methods<br />
PSRegisterHandler<br />
PSUnregisterHandler<br />
130 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
PubSec Declarations<br />
4<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 131
4<br />
PubSec Declarations<br />
132 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigAddedSig<br />
void DigSigAddedSig (PDDoc pdDoc);<br />
Description<br />
Recalculates the number of signature fields and redraws the signature panel after any<br />
signature is added.<br />
Called by the AcroForm plug-in or any agent that adds a signature field.<br />
Parameters<br />
pdDoc<br />
The document that contains the signature field.<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigAddedSigEx<br />
DigSigDeletedSig<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 133
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigAddedSigEx<br />
void DigSigAddedSigEx (PDDoc pdDoc, CosObj cosField);<br />
Description<br />
Recalculates the number of signature fields and redraws the signature panel after a<br />
specified signature field is added.<br />
This version, added in <strong>Acrobat</strong> 6.0, is more efficient than DigSigAddedSig, but requires<br />
that you specify the signature field that is being added.<br />
Parameters<br />
pdDoc<br />
cosField<br />
The document that contains the signature field.<br />
The signature field that was added.<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigAddedSig<br />
DigSigDeletedSigEx<br />
134 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
5<br />
DSAPCreateCompositeTextXObj<br />
CosObj DSAPCreateCompositeTextXObj (const CosDoc cosDoc,<br />
const DSAPTextEntry inText, const ASFixedRect* const bbox,<br />
const CosObj sigField, const CosObj sigAnnot<br />
Description<br />
Creates an new XObject that consists of vertically stacked blocks of text where each block is<br />
automatically sized to fit it own bounding box.<br />
Parameters<br />
cosDoc<br />
inText<br />
bbox<br />
sigField<br />
sigAnnot<br />
The document.<br />
The text to include.<br />
The bounding box, which must already compensate for rotation and<br />
position within the annotation.<br />
The signature field object.<br />
The signature annotation object.<br />
Return Value<br />
The new XObject that contains the text.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigAPXObjectFromLogo<br />
DigSigAPXObjectFromXObjList<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 135
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigAPCreateLayeredStream<br />
Description<br />
Parameters<br />
CosObj DigSigAPCreateLayeredStream(const CosDoc cosDoc,<br />
const CosObj layer1XObject, ASFixedMatrixP layer1Matrix,<br />
const CosObj layer2XObject, ASFixedMatrixP layer2Matrix,<br />
const CosObj layer3Matrix, ASFixedMatrixP layer3Matrix,<br />
const CosObj layerNXObject, ASFixedMatrixP layerNMatrix,<br />
ASInt16 layerNNum, AFPDWidgetBorder border,<br />
PDColorValue cBorder, PDColorValue cBackGnd, ASFixed width,<br />
ASFixed height, PDRotate pdr);<br />
N OTE: Superceded by DigSigAPCreateLayeredStreamEx in <strong>Acrobat</strong> 6.0.<br />
Creates a stream that is composed of either four or five layers:<br />
● layer 0: background, inherited from form annot background<br />
● layer 1: middle, question mark or equivalent (uses the default if layer1XObject is<br />
CosNull)<br />
● layer 2: main, text and appearance (must be provided)<br />
● layer 3: top, blank or X (uses the default if layer1XObject is CosNull)<br />
● layer N: optional very top layer, used for text showing validity state (none if CosNull)<br />
cosDoc<br />
layer1XObject<br />
layer1Matrix<br />
layer2XObject<br />
layer2Matrix<br />
layer3XObject<br />
layer3Matrix<br />
layerNXObject<br />
layerNum<br />
border<br />
cBorder<br />
The document in which to include the standard XObject.<br />
The middle layer.<br />
The position the first layer object.<br />
The text and appearance layer.<br />
The position the second layer object.<br />
The top layer.<br />
The position the third layer object.<br />
An optional validity state layer.<br />
The layer number for the optional validity state layer.<br />
The border from AFPDWidgetGetBorder.<br />
The color of the border.<br />
136 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
5<br />
cBackGnd<br />
width<br />
height<br />
pdr<br />
color of the background.<br />
The width of the new stream object.<br />
The height of the new stream object.<br />
The rotational parameter from AFPDWidgerGetRotation.<br />
Return Values<br />
A new CosStream composed of different layers.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigAPXObjectFromLogo<br />
DigSigAPXObjectFromXObjList<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 137
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigAPCreateLayeredStreamEx<br />
CosObj DigSigAPCreateLayeredStreamEx<br />
(const DSAPCreateLayeredStreamExParams params)<br />
Description<br />
Creates a signature-appearance layered stream, using a parameters structure.<br />
Parameters<br />
N OTE: Supersedes DigSigAPCreateLayeredStream in <strong>Acrobat</strong> 6.0.<br />
params<br />
The parameter structure containing the signature appearance layer<br />
information.<br />
Return Values<br />
A new CosStream composed of different layers.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigAPXObjectFromLogo<br />
DigSigAPXObjectFromXObjList<br />
138 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
5<br />
DigSigAPXObjectFromLogo<br />
CosObj DigSigAPXObjectFromLogo (const CosDoc cosDoc,<br />
const char* logoStr, const ASInt32 logoStrSize,<br />
const ASFixedRect* const logoBBox,<br />
const ASFixedRect* const bbox);<br />
Description<br />
Takes text for a stream logoStr with bounding box logoBBox and fits it precisely to<br />
bbox. Performs uniform x and y scaling, and x-y translation. Can raise an exception. This<br />
method might throw, and should be wrapped in a DURING/HANDLER block.<br />
Parameters<br />
cosDoc<br />
logoStr<br />
logoStrSize<br />
logoBbox<br />
bbox<br />
The document.<br />
The stream containing the text.<br />
The length of the logo string, or 0 to calculate the length<br />
automatically.<br />
The bounding box for logoStr.<br />
The bounding rectangle of the result.<br />
Return Value<br />
A Cos object XObject that contains the logo.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DSAPCreateCompositeTextXObj<br />
DigSigAPCreateLayeredStream<br />
DigSigAPXObjectFromXObjList<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 139
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigAPXObjectFromXObjList<br />
CosObj DigSigAPXObjectFromXObjList (CosDoc cosDoc,<br />
const ASFixedRect* const bbox, DSAPXObjEntry objEntry,<br />
TextAppearanceP ta, AFPDWidgetBorder border, ASBool bMerge);<br />
Description<br />
Creates a new XObject from the list of DSAPXObjEntry objects. Each object in the list is<br />
either an existing stream or a string that will be laid out and reflowed into a new stream.<br />
The streams are then turned into XObjects. Controls allow you to adjust the vertical<br />
position of each stream within bbox. If bMerge is true then this method combines the<br />
new XObjects into one large XObject, and the sub XObjects are destroyed. Otherwise the<br />
method leaves the component XObjects intact and new XObjects are created but not<br />
destroyed for the text entries. Text streams use the text attributes of ta.<br />
Parameters<br />
cosDoc<br />
bbox<br />
objEntry<br />
ta<br />
border<br />
bMerge<br />
The document in which to include the standard XObject.<br />
The bounding box for the signature.<br />
A list of DSAPXObjEntry objects.<br />
The text appearance.<br />
For an explanation of the TextAppearanceP type, see "AcroForm<br />
Declarations" in <strong>Acrobat</strong> Forms <strong>API</strong> <strong>Reference</strong>.<br />
The border style for the signature, as returned by<br />
AFPDWidgetGetBorder .<br />
For an explanation of the AFPDWidgetBorder type, see "AcroForm<br />
Declarations" in <strong>Acrobat</strong> Forms <strong>API</strong> <strong>Reference</strong>.<br />
When false, keep sub XObjects. When true, combine them all into<br />
one large one.<br />
Return Value<br />
XObject composed from list.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DSAPCreateCompositeTextXObj<br />
DigSigAPCreateLayeredStream<br />
DigSigAPXObjectFromLogo<br />
140 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
5<br />
DigSigByteToHex<br />
void DigSigByteToHex (unsigned char* byteP,<br />
unsigned char* hexP, ASInt32 length);<br />
Description<br />
Converts a byte string to a PDF hex string.<br />
Parameters<br />
byteP<br />
hexP<br />
length<br />
A pointer to the byte string.<br />
(Filled by the method) A pointer to an output buffer to hold the hex string.<br />
Must be at least (length * 2) + 3 bytes. The string begins with “”, followed by a NULL character. For example, the two byte string<br />
“A/” is converted to “\0.”<br />
The length of the byte string, in bytes<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigHexToByte<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 141
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigClearSig<br />
void DigSigClearSig (PDDoc pdDoc, CosObj sigField);<br />
Description<br />
Clears a signature field in a document. This removes the signature, so that the document is<br />
unsigned.<br />
Parameters<br />
pdDoc<br />
sigField<br />
The document.<br />
The signature field to clear.<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigVerifySig<br />
142 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
5<br />
DigSigClearSigRefDict<br />
DSRetCode DigSigClearSigRefDict (ASAtom transformMethod,<br />
CosObj sigDict, CosObj refDict );<br />
Description<br />
Clears the signature reference dictionary referred to by refDict and removes any<br />
reference to it from the document.<br />
Parameters<br />
transformMethod<br />
sigDict<br />
refDict<br />
The transform method. It should match the one contained in<br />
sigDict.<br />
The signature dictionary containing the signature reference<br />
dictionary.<br />
The signature reference dictionary.<br />
Return Value<br />
Positive on success.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigCommitSigRefDict<br />
DigSigFinishSigRefDict<br />
DigSigNewSigRefDict<br />
DigSigVerifySigRefDict<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 143
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigClick<br />
void DigSigClick (PDAnnot pdAnnot, AVPageView avPV,<br />
ASInt16 nX, ASInt16 nY, ASInt16 nFlags, ASInt16 nClicks);<br />
Description<br />
The AcroForm plug-in calls this method when a user left-clicks inside a signature<br />
annotation.<br />
Parameters<br />
pdAnnot<br />
avPV<br />
nX<br />
nY<br />
nFlags<br />
nClicks<br />
The annotation the user clicked on<br />
The page view that contains the annotation.<br />
The x-coordinate of the mouse click, specified in device space coordinates.<br />
The y-coordinate of the mouse click, specified in device space coordinates.<br />
Indicates which modifier keys are pressed, if any. Must be an OR of the<br />
Modifier Keys values, which are the following:<br />
● AV_COMMAND<br />
● AV_OPTION<br />
● AV_CONTROL<br />
● AV_SHIFT<br />
The number of clicks.<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigDraw<br />
DigSigHexToByte<br />
DigSigRightClick<br />
144 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
5<br />
DigSigCommitSigRefDict<br />
DSRetCode DigSigCommitSigRefDict (ASAtom transformMethod,<br />
CosObj sigDict, CosObj pOutRefDict );<br />
Description<br />
Adds a signature reference dictionary to the document and saves the document.<br />
This method uses the information that was provided in the DSSigRefDictErrParams<br />
parameter block during the call toDigSigNewSigRefDict.transformMethod and<br />
sigDict should match the values provided at that time.<br />
After this operation, some of the values in the reference dictionary are still dummy values,<br />
including DigestValue and DigestLocation (see Section 8.7, "<strong>Digital</strong> <strong>Signature</strong>s" in the PDF<br />
<strong>Reference</strong> for more information). DigSigFinishSigRefDict should be called next to<br />
fill in these values.<br />
If signing is cancelled after this operation, DigSigClearSigRefDict should be called<br />
to remove all references to the reference dictionary from the document.<br />
Parameters<br />
transformMethod The transform method.<br />
sigDict<br />
refDict<br />
The signature dictionary that contains the signature reference<br />
dictionary.<br />
(Filled by the method) A pointer to the committed signature<br />
reference dictionary.<br />
Return Value<br />
kDSTrue on success; kDSFalse on parameter error; kDSException for all other errors.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigClearSigRefDict<br />
DigSigFinishSigRefDict<br />
DigSigNewSigRefDict<br />
DigSigVerifySigRefDict<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 145
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigComparePages<br />
ASBool DigSigComparePages (PDDoc docA, PDDoc docB,<br />
ASBool insertDiffs);<br />
Description<br />
Compares the pages of two documents, producing a third document of the differences.<br />
Parameters<br />
N OTE: Superceded by DigSigComparePagesEx in <strong>Acrobat</strong> 6.0.<br />
docA<br />
docB<br />
insertDiffs<br />
First document to compare.<br />
Second document to compare.<br />
Not used.<br />
Return Value<br />
true if the pages of the documents are identical, false otherwise.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigCompareWords<br />
146 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
5<br />
DigSigComparePagesEx<br />
ASBool DigSigComparePagesEx (PDDoc docA, PDDoc docB,<br />
DSComparePagesParams params);<br />
Description<br />
Compares the pages of two documents, producing a third document of the differences.<br />
Parameters<br />
docA<br />
docB<br />
params<br />
First document being compared.<br />
Second document being compared.<br />
A structure containing the sensitivity level for the comparison.<br />
Return Value<br />
true if the pages of the documents are identical, false otherwise.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigComparePages<br />
DigSigCompareWords<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 147
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigCompareWords<br />
ASBool DigSigCompareWords (PDDoc docA, PDDoc docB,<br />
ASBool iUseFonts);<br />
Description<br />
Compares the words of two documents, producing a third document of the differences.<br />
Parameters<br />
N OTE: Superceded by DigSigCompareWordsEx in <strong>Acrobat</strong> 6.0.<br />
docA<br />
docB<br />
iUseFonts<br />
First document being compared.<br />
Second document being compared.<br />
If true, the font name, size, and color of each character in a word are<br />
considered when matching against other words. If false, these<br />
attributes are ignored.<br />
Return Value<br />
true if the words of the documents are identical, false otherwise.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigComparePages<br />
DigSigCompareWordsAndFontsRecent<br />
DigSigCompareWordsEx<br />
DigSigCompareWordsRecent<br />
148 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
5<br />
DigSigCompareWordsAndFontsRecent<br />
ASBool DigSigCompareWordsAndFontsRecent (PDDoc docA,<br />
PDDoc docB, ASBool iUseFonts);<br />
Description<br />
Compares the words of two documents, taking into account possible font changes, and<br />
produced a third document of the differences.<br />
Parameters<br />
N OTE: Superceded by DigSigCompareWordsEx in <strong>Acrobat</strong> 6.0.<br />
docA<br />
docB<br />
iUseFonts<br />
First document being compared.<br />
Second document being compared.<br />
If true, the font name, size, and color of each character in a word are<br />
considered when matching against other words. If false, these<br />
attributes are ignored.<br />
Return Value<br />
true if the words of the documents are identical, false otherwise.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigComparePages<br />
DigSigCompareWords<br />
DigSigCompareWordsEx<br />
DigSigCompareWordsRecent<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 149
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigCompareWordsEx<br />
ASBool DigSigCompareWordsEx (PDDoc docA, PDDoc docB,<br />
DSCompareWordsParams params);<br />
Description<br />
Compares the words of two documents, producing a third document of the differences.<br />
N OTE:<br />
Supercedes DigSigCompareWords,<br />
DigSigCompareWordsAndFontsRecent, and<br />
DigSigCompareWordsRecent in <strong>Acrobat</strong> 6.0.<br />
Parameters<br />
docA<br />
docB<br />
params<br />
First document being compared.<br />
Second document being compared.<br />
A structure containing the comparison parameters.<br />
Return Value<br />
true if the words of the documents are identical, false otherwise.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigComparePagesEx<br />
DigSigCompareWords<br />
DigSigCompareWordsAndFontsRecent<br />
DigSigCompareWordsRecent<br />
150 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
5<br />
DigSigCompareWordsRecent<br />
ASBool DigSigCompareWordsRecent (PDDoc docA, PDDoc docB,<br />
ASBool iUseFonts);<br />
Description<br />
Compares the words of two documents, producing a third document of the differences.<br />
Parameters<br />
N OTE: Superceded by DigSigCompareWordsEx in <strong>Acrobat</strong> 6.0.<br />
docA<br />
docB<br />
iUseFonts<br />
First document being compared.<br />
Second document being compared.<br />
If true, the font name, size, and color of each character in a word are<br />
considered when matching against other words. If false, these<br />
attributes are ignored.<br />
Return Value<br />
true if the words of the documents are identical, false otherwise.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigComparePages<br />
DigSigCompareWords<br />
DigSigCompareWordsAndFontsRecent<br />
DigSigCompareWordsEx<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 151
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigCosObjOverwrite<br />
ASInt32 DigSigCosObjOverwrite (ASFile asFile,<br />
const DigSigOffset digSigOffset, const CosObj cosObj,<br />
DSOverwriteType dsOverwriteType);<br />
Description<br />
Overwrites the part of a file containing the specified cosObj, which contains data of the<br />
specified type. Reopens the file for write, positions to the specified location, and directly<br />
writes the characters, as appropriate to the type.<br />
Introduced in <strong>Acrobat</strong> 6.0.<br />
Parameters<br />
asFile<br />
digSigOffset<br />
cosObj<br />
dsOverwriteType<br />
The file containing the cosObj.<br />
The location of the cosObj in the file, with the byte<br />
position and number of bytes to overwrite.<br />
● Does not write and returns 0 if the formatted length<br />
is longer than the length in digSigOffset.<br />
● Writes padding spaces to the file if formatted length<br />
is less than the length in digSigOffset.<br />
The cosString to be written.<br />
Does not write and returns 0 if there are any illegal<br />
characters in the string.<br />
The type of overwrite to perform.<br />
● DSOverwriteStringHex (equivalent to calling<br />
DigSigOverwriteHexstring)<br />
● DSOverwriteArray (equivalent to calling<br />
DigSigOverwriteIntArray)<br />
● DSOverwriteStringBase64<br />
Return Value<br />
Non-zero if successful. 0 if the formatted length is longer than the length in<br />
digSigOffset, or if there are any illegal characters in the string.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigFileGetEOF<br />
DigSigFileSetPos<br />
DigSigFileRead<br />
DigSigOverwriteBytes<br />
152 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
5<br />
DigSigOverwriteHexstring<br />
DigSigOverwriteIntArray<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 153
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigCreateStdXObj<br />
CosObj DigSigCreateStdXObj (const CosDoc cosDoc,<br />
const ASFixedRect* pBBoxRec, DSXObjType dsXObjType);<br />
Description<br />
Returns a new XObject with the specified bounding box. Unlike the XObject returned by<br />
DigSigGetStdXObj, DigSig does not attach the XObject returned by this function to the<br />
CosDoc.<br />
Parameters<br />
cosDoc<br />
pBBoxRec<br />
dsXObjType<br />
The document containing the new object.<br />
A pointer to desired bounding box.<br />
The type of object to create.<br />
Return Value<br />
A CosObj containing the new XObject form, or CosNewNull if unsuccessful<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigGetStdXObj<br />
154 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
5<br />
DigSigDeletedSig<br />
void DigSigDeletedSig (PDDoc pdDoc);<br />
Description<br />
Recalculates the number of signature fields and redraws the signature panel after any<br />
signature is deleted.<br />
Called by the AcroForm plug-in or any agent that deletes a signature field.<br />
Parameters<br />
pdDoc<br />
The document that contains a signature field.<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigAddedSig<br />
DigSigDeletedSigEx<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 155
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigDeletedSigEx<br />
void DigSigDeletedSigEx (PDDoc pdDoc, CosObj cosField);<br />
Description<br />
Recalculates the number of signature fields and redraws the signature panel after a<br />
specified signature is deleted.<br />
This version, added in <strong>Acrobat</strong> 6.0, is more efficient than DigSigDeletedSig, but<br />
requires that you specify the signature field that is being deleted.<br />
Parameters<br />
pdDoc<br />
cosField<br />
The document that contained the signature field.<br />
The signature field that was deleted.<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigAddedSigEx<br />
DigSigDeletedSig<br />
156 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
5<br />
DigSigDocModifiedAfterSig<br />
ASBool DigSigDocModifiedAfterSig (PDDoc doc, CosObj sigField);<br />
Description<br />
Tests whether a document has been modified since being signed with the specified<br />
signature.<br />
Parameters<br />
pdDoc<br />
sigfield<br />
The document containing the signature field.<br />
The signature field.<br />
Return Value<br />
ASBool true if the document has been modified, false otherwise.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
None<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 157
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigDoProperties<br />
void DigSigDoProperties (AVDoc avDoc, CosObj sigField);<br />
Description<br />
Opens DigSig’s property dialog.<br />
Parameters<br />
avDoc<br />
sigField<br />
The document that contained the signature field.<br />
The signature field of the document.<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
None<br />
158 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
5<br />
DigSigDraw<br />
void DigSigDraw (PDAnnot pdAnnot, AVPageView avPV,<br />
ASBool bIsSelected);<br />
Description<br />
Causes the signature to be redrawn.<br />
Parameters<br />
pdAnnot<br />
avPV<br />
blsSelected<br />
The annotation the user clicked on or tabbed into<br />
The page view that contains the annotation<br />
true if the annotation is selected, false otherwise<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigHexToByte<br />
DigSigRightClick<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 159
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigEnum<strong>Signature</strong>s<br />
void DigSigEnum<strong>Signature</strong>s (PDDoc pdDoc, DigSigEnumProc proc,<br />
void *clientData);<br />
Description<br />
Enumerates the signature fields (signed and unsigned) in the file.<br />
Parameters<br />
pdDoc<br />
proc<br />
clientData<br />
The document that contains the signature field.<br />
The procedure to call once for each existing signature.<br />
Pointer to user-supplied data to pass to proc each time it is called.<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Callbacks<br />
DigSigEnumProc<br />
160 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
5<br />
DigSigFileGetEOF<br />
ASInt32 DigSigFileGetEOF (ASFile asFile);<br />
Description<br />
Gets the number of bytes in an ASFile. Serves as a wrapper for the ASFileGetEOF<br />
method.<br />
Parameters<br />
asFile<br />
The ASFile whose length is obtained.<br />
Return Value<br />
Number of bytes in the ASFile, or 0 if an error is encountered.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigFileSetPos<br />
DigSigFileRead<br />
DigSigOverwriteIntArray<br />
DigSigOverwriteHexstring<br />
DigSigOverwriteBytes<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 161
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigFileRead<br />
ASInt32 DigSigFileRead (ASFile asFile, char* p,<br />
ASInt32 count);<br />
Description<br />
Reads from an ASFile. This is a wrapper function for the ASFileRead method.<br />
Parameters<br />
asFile<br />
p<br />
count<br />
The ASFile to read.<br />
Pointer to a buffer.<br />
Number of bytes to read into the buffer.<br />
Return Value<br />
Number of bytes read, or 0 if unsuccessful.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigFileGetEOF<br />
DigSigFileSetPos<br />
DigSigOverwriteIntArray<br />
DigSigOverwriteHexstring<br />
DigSigOverwriteBytes<br />
162 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
5<br />
DigSigFileSetPos<br />
void DigSigFileSetPos (ASFile asFile, ASInt32 pos);<br />
Description<br />
Reopens an ASFile for reading and sets the file position.<br />
Parameters<br />
asFile<br />
pos<br />
The ASFile to position.<br />
The byte offset to a position in asFile<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigFileGetEOF<br />
DigSigFileRead<br />
DigSigOverwriteIntArray<br />
DigSigOverwriteHexstring<br />
DigSigOverwriteBytes<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 163
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigFinishSigRefDict<br />
DSRetCode DigSigFinishSigRefDict (ASAtom transformMethod,<br />
CosObj sigDict, CosObj refDict,<br />
DSSigRefDictErrParams errParams);<br />
Description<br />
Computes the digest value and stores it in the reference dictionary. It should be called after<br />
DigSigCommitSigRefDict.<br />
Parameters<br />
transformMethod The transform method used to calculate the digest. It must<br />
match originally specified in DigSigNewSigRefDict<br />
sigDict The signature dictionary that contains the signature<br />
reference dictionary.<br />
refDict<br />
errParams<br />
The reference dictionary returned from the call to<br />
DigSigCommitSigRefDict<br />
A structure containing information about an exception.<br />
Return Value<br />
kDSTrue on success; kDSFalse on parameter error. kDSException means an<br />
exception, and the information about it can be found in errParams.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigClearSigRefDict<br />
DigSigCommitSigRefDict<br />
DigSigNewSigRefDict<br />
DigSigVerifySigRefDict<br />
164 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
5<br />
DigSigGetDocAuthor<strong>Signature</strong><br />
CosObj DigSigGetDocAuthor<strong>Signature</strong> (PDDoc doc);<br />
Description<br />
Gets the author signature for a document as a Cos object.<br />
Parameters<br />
doc<br />
The document for which the author signature is obtained.<br />
Return Value<br />
The CosObj containing the author signature.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigGetDocMDPSetting<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 165
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigGetDocMDPSetting<br />
DSMDPType DigSigGetDocMDPSetting (PDDoc doc);<br />
Description<br />
Gets the MDP setting for the author signature for the specified document.<br />
Parameters<br />
doc<br />
The document for which the MDP setting is obtained.<br />
Return Value<br />
The MDP setting of the document’s author signature, or kDSMDPNone if there is no author<br />
signature.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigGetDocAuthor<strong>Signature</strong><br />
166 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
5<br />
DigSigGetStdXObj<br />
CosObj DigSigGetStdXObj (CosDoc cosDoc,DSXObjType dsXObjType);<br />
Description<br />
Gets a Cos XObject for one of the standard signature graphics: blank, question mark, and<br />
cross.<br />
Creates an AcroForm dictionary if none exists in the document, makes a Default Resources<br />
(DR) dictionary if none exists, creates an XObject dictionary if none exists, and creates three<br />
standard XObjects: DSBlankXObj, DSUnknownXObj, and DSInvalidXObj if they do<br />
not exist. These objects may be used to modify the appearance of a digital signature. Each<br />
object has a bounding box of 100 x 100 points and an identity transformation matrix.<br />
Parameters<br />
cosDoc<br />
dsXObjType<br />
The document in which to include the standard XObject.<br />
The type of object to get.<br />
Return Value<br />
Returns the CosObj of the desired type, or CosNewNull if unsuccessful.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
None<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 167
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigGetUbiquity<strong>Signature</strong><br />
CosObj DigSigGetUbiquity<strong>Signature</strong> (PDDoc doc);<br />
Description<br />
Gets the Reader Extensions signature for a document as a Cos object.<br />
Parameters<br />
doc<br />
The document for which the Reader Extensions signature is obtained.<br />
Return Value<br />
The CosObj containing the Reader Extensions signature.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigGetDocAuthor<strong>Signature</strong><br />
168 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
5<br />
DigSigGetUniqueTitle<br />
char* DigSigGetUniqueTitle (CosDoc cosDoc);<br />
Description<br />
Gets a character string that is suitable as the field name for a new signature field. This is<br />
guaranteed not to duplicate an existing field name. Typically, this name would be of the<br />
form XXXXnnn, where XXXX is the word “signature” in a local Latin-alphabet language, and<br />
nnn is a unique integer.<br />
Parameters<br />
cosDoc<br />
The document that will contain the new field.<br />
Return Value<br />
The unique field name string.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
None<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 169
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigHexToByte<br />
void DigSigHexToByte (unsigned char* hexP,<br />
unsigned char* byteP, ASInt32 length);<br />
Description<br />
Converts a PDF hex string to a byte string. For example, the 6-byte string converts<br />
to the 2-byte string (A/).<br />
The first byte of the hex string is ignored. The last byte of an even length hex string is<br />
ignored.<br />
Middle bytes outside the ranges 0-9, a-f, and A-F are treated as 0. Pairs of middle bytes are<br />
converted to byte values 0-255 and stored in the output buffer.<br />
Parameters<br />
hexP Pointer to the hex string. The string must begin with “”,<br />
optionally followed by a NULL character.<br />
byteP<br />
length<br />
(Filled by the method) Pointer to an output buffer to hold the byte string.<br />
Must be at least (length - 2) / 2 bytes long.<br />
Length of the hex string in bytes, not including any trailing NULL character,<br />
that is, strlen(hexP).<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigByteToHex<br />
170 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
5<br />
DigSigIsDocSigned<br />
ASBool DigSigIsDocSigned (PDDoc doc);<br />
Description<br />
Tests whether a document is signed.<br />
Parameters<br />
doc<br />
The document that is tested.<br />
Return Value<br />
true if the document is signed, false otherwise.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigIsSigSigned<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 171
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigIsSigSigned<br />
ASBool DigSigIsSigSigned (PDDoc doc, CosObj sigField);<br />
Description<br />
Tests whether a particular signature field in a document is signed.<br />
Parameters<br />
doc<br />
sigField<br />
The document that contains the signature field.<br />
The signature field that is tested.<br />
Return Value<br />
true if the signature field is signed, false otherwise.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigIsDocSigned<br />
172 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
5<br />
DigSigKeyDown<br />
void DigSigKeyDown (PDAnnot pdAnnot, AVPageView avpv,<br />
ASUns16 nKey, ASInt16 nFlags);<br />
Description<br />
The AcroForm plug-in calls this method when the user tabs to a signature annotation and<br />
activates it by pressing the spacebar or Enter key, which is equivalent to a left-mouse click.<br />
The parameters parallel those of the AVAnnotHandlerDoKeyDownProc callback. If the<br />
key pressed is an ASCII , this method selects the annotation.<br />
Parameters<br />
pdAnnot<br />
avpv<br />
nKey<br />
nFlags<br />
The annotation the user clicked on.<br />
The current page view.<br />
The key pressed by the user.<br />
Indicates which modifier keys are pressed, if any. Must be an OR of the<br />
Modifier Keys values, which are the following:<br />
● AV_COMMAND<br />
● AV_OPTION<br />
● AV_CONTROL<br />
● AV_SHIFT<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigDraw<br />
DigSigClick<br />
DigSigRightClick<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 173
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigMD5ByteRange<br />
ASInt32 DigSigMD5ByteRange (ASFile asFile, CosObj byteRange,<br />
char* md5hash);<br />
Description<br />
Calculates the MD5 hash function over a set of byte ranges in a file.<br />
Parameters<br />
asFile<br />
byteRange<br />
md5hash<br />
The file over which the hash function is calculated.<br />
An array of pairs of integers specifying byte offset and length of one or<br />
more subsets of the file. The hash function is calculated over all these<br />
subsets, concatenated in order.<br />
A pointer to a buffer that receives the 16-byte hash value.<br />
Return Value<br />
The MD-5 hash function over a set of byte ranges in asFile. Also returns the total number of<br />
bytes over which the hash is calculated. Returns 0 if the byte range array has an odd<br />
number of elements or if unsuccessful.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
None<br />
174 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
5<br />
DigSigNewSigRefDict<br />
DSRetCode DigSigNewSigRefDict (DSSigRefDictParams refParams,<br />
DSSigRefDictErrParams errParams);<br />
Description<br />
Begins the process of creating a new signature reference dictionary containing an object<br />
digest. The caller fills in the values of the refParams structure.<br />
In this method, no persistent changes are made to the document; therefore, it is safe to<br />
cancel the creation of the reference dictionary without any cleanup. To save the file,<br />
DigSigCommitSigRefDict should be called next.<br />
Parameters<br />
refParams<br />
errParams<br />
A structure containing information about the signature<br />
reference dictionary; must be filled in by the caller.<br />
(Filled by the method) A structure containing information<br />
about exceptions that occurred.<br />
Return Value<br />
kDSTrue on success; kDSFalse on parameter errors.<br />
kDSException means an exception occurred; information can be found in errParams.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigClearSigRefDict<br />
DigSigCommitSigRefDict<br />
DigSigFinishSigRefDict<br />
DigSigVerifySigRefDict<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 175
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigOverwriteBytes<br />
ASInt32 DigSigOverwriteBytes (ASFile asFile,<br />
const DigSigOffset digSigOffset, const char* p);<br />
Description<br />
Overwrites any or all entries in a signature dictionary. Reopens the file for write, positions to<br />
the specified place, and writes exactly the number of bytes specified in digSigOffset.<br />
N OTE:<br />
To overwrite a text string entry, such as /Reason, the string must be in the format<br />
"< xxx >", not "xxx".<br />
Parameters<br />
asFile<br />
digSigOffset<br />
p<br />
The ASFile to write to.<br />
A structure specifying the byte position and size to overwrite.<br />
A byte string to be written. Must be in the correct format, given the<br />
type of entry as defined in Section 8.7 in the PDF <strong>Reference</strong>.<br />
Return Value<br />
The number of bytes written, or 0 if unsuccessful.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigCosObjOverwrite<br />
DigSigFileGetEOF<br />
DigSigFileSetPos<br />
DigSigFileRead<br />
DigSigOverwriteIntArray<br />
DigSigOverwriteHexstring<br />
176 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
5<br />
DigSigOverwriteHexstring<br />
ASInt32 DigSigOverwriteHexstring (ASFile asFile,<br />
const DigSigOffset digSigOffset, const CosObj cosObj);<br />
Description<br />
Overwrites part of a file with a hex string. Reopens the file for write, positions to the<br />
specified location, formats the string as characters, and writes. This method is used to<br />
overwrite the /Contents entry in the signature dictionary.<br />
Parameters<br />
asFile<br />
digSigOffset<br />
cosObj<br />
The ASFile to write to.<br />
A structure specifying the byte position and size to overwrite.<br />
● Writes padding blanks to the file if formatted length is less than<br />
this length.<br />
● Does not write and returns 0 if the formatted length is longer than<br />
this length.<br />
● Does not write and returns 0 if the formatted length is greater<br />
than 8200 bytes.<br />
The Cos string to be written.<br />
Return Value<br />
The number of bytes written.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigCosObjOverwrite<br />
DigSigFileGetEOF<br />
DigSigFileSetPos<br />
DigSigFileRead<br />
DigSigOverwriteIntArray<br />
DigSigOverwriteBytes<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 177
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigOverwriteIntArray<br />
ASInt32 DigSigOverwriteIntArray (ASFile asFile,<br />
const DigSigOffset digSigOffset, const CosObj cosObj);<br />
Description<br />
Overwrites part of asFile with an integer array. Reopens the file for write, positions to the<br />
specified place, formats the array as characters, and writes. This method is used to<br />
overwrite the /ByteRange entry in the signature dictionary.<br />
Parameters<br />
asFile<br />
digSigOffset<br />
cosObj<br />
The ASFile to write to.<br />
A structure specifying the byte position and size to overwrite.<br />
● Writes padding blanks to the file if formatted length is less than<br />
this length.<br />
● Does not write and returns 0 if the formatted length is longer<br />
than this length.<br />
● Does not write and returns 0 if the formatted length is greater<br />
than 8200 bytes.<br />
The Cos string to be written.<br />
Return Value<br />
The number of bytes written.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigCosObjOverwrite<br />
DigSigFileGetEOF<br />
DigSigFileSetPos<br />
DigSigFileRead<br />
DigSigOverwriteHexstring<br />
DigSigOverwriteBytes<br />
178 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
5<br />
DigSigRegisterFilter<br />
void DigSigRegisterFilter (ExtensionID owner,<br />
DigSigHandler digSigHandler);<br />
Description<br />
Registers a signing method plug-in. A signing plug-in must call this method before making<br />
any signatures. This object should not be destroyed until after it is unregistered or until exit.<br />
Parameters<br />
owner<br />
digSigHandler<br />
The handler plug-in identifier, assigned on initialization.<br />
A structure specifying the name of the filter and the functions to<br />
call to create and validate signatures.<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigUnregisterFilter<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 179
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigRegisterObserver<br />
ASInt32 DigSigRegisterObserver<br />
(DSNotificationType notificationID,<br />
DSNotificationProc notifyProc,<br />
DSNotificationFailureProc notifyFailure, void *clientData);<br />
Description<br />
Registers callbacks with the notification server, to be called for specific digital signature<br />
events. Events are:<br />
● Adding or deleting a signature field.<br />
● Requesting a new signature, and the success or failure of the request.<br />
● Requesting that an existing signature be cleared, and the success or failure of the<br />
request.<br />
Parameters<br />
notificationID<br />
notifyProc<br />
notifyFailure<br />
clientData<br />
The type of event for which to register a callback.<br />
The procedure to call when a field change, request, or success<br />
event occurs.<br />
The procedure to call when a failure event occurs.<br />
A pointer to client-supplied data to pass to the callback<br />
procedure.<br />
Return Value<br />
The observer identifier, which must be provided to DigSigUnregisterObserver.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigUnregisterObserver<br />
180 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
5<br />
DigSigRightClick<br />
void DigSigRightClick (PDAnnot pdAnnot, AVPageView avPV,<br />
ASInt16 nX, ASInt16 nY, ASInt16 nFlags, ASInt16 nClicks);<br />
Description<br />
Invokes the signature-panel pull-right menu and allows the user to select an action.<br />
Parameters<br />
pdAnnot<br />
avPV<br />
nX<br />
nY<br />
nFlags<br />
nClicks<br />
The annotation the user clicked on.<br />
The page view the annotation is within.<br />
The x-coordinate of the mouse click, specified in device space coordinates.<br />
The y-coordinate of the mouse click, specified in device space coordinates<br />
Indicates which modifier keys are pressed, if any. Must be an OR of the<br />
Modifier Keys values, which are the following:<br />
● AV_COMMAND<br />
● AV_OPTION<br />
● AV_CONTROL<br />
● AV_SHIFT<br />
The number of clicks.<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigDraw<br />
DigSigHexToByte<br />
DigSigClick<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 181
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigRollbackToSig<br />
void DigSigRollbackToSig (PDDoc pdDoc, CosObj sigField);<br />
Description<br />
Creates a new temporary file that corresponds to the state of the file after the specified<br />
signature was applied.<br />
Parameters<br />
pdDoc<br />
sigField<br />
The document that contained the signature field.<br />
The signature field of the document.<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
None<br />
182 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
5<br />
DigSigSignDoc<br />
void DigSigSignDoc (PDDoc pdDoc, CosObj sigField,<br />
ASAtom filterKey);<br />
Description<br />
Signs and saves a document, using the specified field and signing method. If sigField is<br />
NULL, makes a field of size 0x0 points.<br />
Parameters<br />
pdDoc<br />
sigField<br />
filtrKey<br />
The document to be signed.<br />
The field to be signed or CosNull.<br />
The signing method to use.<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
None<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 183
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigUnregisterFilter<br />
void DigSigUnregisterFilter (DigSigHandler digSigHandler);<br />
Description<br />
Unregisters a signing method plug-in. The caller should deallocate the DigSigHandler<br />
object after making this call.<br />
Parameters<br />
digSigHandler<br />
A structure specifying the name of the filter and the functions to<br />
call to create and validate signatures.<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigRegisterFilter<br />
184 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
5<br />
DigSigUnregisterObserver<br />
void DigSigUnregisterObserver<br />
(DSNotificationType notificationID, ASInt32 observerID);<br />
Description<br />
Unregisters an event interest from the notification server.<br />
Parameters<br />
notificationID<br />
observerID<br />
The event for which an interest has been registered, as specified<br />
in DigSigRegisterObserver.<br />
The observer identifier as returned by<br />
DigSigRegisterObserver.<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigRegisterObserver<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 185
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigUpdatePanel<br />
void DigSigUpdatePanel (PDDoc pdDoc);<br />
Description<br />
Updates the signature panel, if any, associated with pdDoc.<br />
Parameters<br />
pdDoc<br />
The document whose panel is to be updated.<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
None<br />
186 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
5<br />
DigSigVerifySig<br />
DSValidState DigSigVerifySig (PDDoc pdDoc, CosObj sigField,<br />
ASBool bUI);<br />
Description<br />
Verifies a digital signature.<br />
Parameters<br />
pdDoc<br />
sigField<br />
bUI<br />
The document.<br />
The signature field to verify.<br />
When true, can bring up the user-interface dialogs if needed.<br />
Return Value<br />
The validity state that results from verification.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigClearSig<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 187
5<br />
<strong>Digital</strong> <strong>Signature</strong> Methods<br />
DigSigVerifySigRefDict<br />
DSRetCode DigSigVerifySigRefDict (ASAtom transformMethod,<br />
CosObj sigDict, CosObj refDict,<br />
DSSigRefDictErrParams errParams );<br />
Description<br />
Verifies an object signature stored in a signature reference dictionary. It involves computing<br />
the object digest using the transform method and comparing it to the digest value stored<br />
in the reference dictionary.<br />
Parameters<br />
transformMethod<br />
The transform method used to calculate the signature. It must<br />
match the one stored in refDict<br />
sigDict The signature dictionary that contains the signature<br />
reference dictionary.<br />
refDict<br />
errParams<br />
The signature reference dictionary that was returned from a<br />
call to DigSigCommitSigRefDict<br />
A structure containing information about an exception.<br />
Return Value<br />
kDSTrue on success; kDSFalse on parameter error. kDSException means an<br />
exception, and the information about it can be found in errParams.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigClearSigRefDict<br />
DigSigCommitSigRefDict<br />
DigSigFinishSigRefDict<br />
DigSigNewSigRefDict<br />
188 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
6<br />
<strong>Digital</strong> <strong>Signature</strong> Callbacks<br />
DigSigEnumProc<br />
ACCB1 ASBool ACCB2 DigSigEnumProc (PDDoc pdDoc,<br />
CosObj sigField, void *clientdata);<br />
Description<br />
User-supplied callback that is passed in the call to DigSigEnum<strong>Signature</strong>s. DigSig<br />
calls this once for each existing signature.<br />
Parameters<br />
pdDoc<br />
sigField<br />
clientData<br />
The document that contains the signature field.<br />
The signature field.<br />
Pointer to user-supplied data to pass to proc each time it is called.<br />
Return Value<br />
true to continue enumeration, false otherwise.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigEnum<strong>Signature</strong>s<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 189
6<br />
<strong>Digital</strong> <strong>Signature</strong> Callbacks<br />
DSCanValidateProc<br />
ACCB1 ASBool(ACCB2 *DSCanValidateProc)<br />
(PDDoc pdDoc, CosObj sigField, CosObj sigAnnot,<br />
ASAtom filter);<br />
Description<br />
This function is called to query the handler to find out if it can validate this PDDoc<br />
signature field. The call determines if the general signature format is supported by the<br />
handler, or if the handler should be given the opportunity to validate this signature.<br />
If the response is false, the handler cannot be called to validate the signature. In this<br />
event, the handler will not be able to provide other information (for example that an<br />
updated version of the handler should be obtained in order to validate the signature).<br />
Parameters<br />
pdDoc<br />
sigField<br />
sigAnnot<br />
filter<br />
The document that contains the signature field.<br />
The signature field.<br />
The signature annotation that is being verified (usually equivalent to<br />
sigField).<br />
The name by which DigSig knows this handler. This is not necessarily<br />
the value of /Filter.<br />
Return Value<br />
true if the handler can validate the field signature, false otherwise.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigVerifySig<br />
190 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Callbacks<br />
6<br />
DSClearSigProc<br />
void DSClearSigProc (PDDoc pdDoc, CosObj sigField,<br />
CosObj sigAnnot);<br />
Description<br />
DigSig uses this callback to send notification that it has cleared the signature. This clears<br />
the local caching.<br />
Parameters<br />
pdDoc<br />
sigField<br />
sigAnnot<br />
The document being signed.<br />
<strong>Signature</strong> field.<br />
Cos object of the signature annotation.<br />
Return Value<br />
None.<br />
Header File<br />
DigSigHFT.h<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 191
6<br />
<strong>Digital</strong> <strong>Signature</strong> Callbacks<br />
DSCommitSignProc<br />
ACCB1 ASBool ACCB2 DSCommitSignProc (PDDoc pdDoc,<br />
void* sigData, CosObj sigField, CosObj sigAnnot,<br />
DigSigOffset* offsetArray, ASInt32* arrayCount);<br />
Description<br />
Callback for DigSigHandler. Called to put signature into document in memory or to<br />
cancel. Modifies the signature dictionary as needed. May allocate storage for an array of<br />
signature objects.<br />
The signature includes a signature dictionary written to the /V attribute of the sigField<br />
and an optional appearance written to the /AP dictionary of the sigAnnot.<br />
See Section 8.7 in the PDF <strong>Reference</strong> for the format of the signature dictionary. At least two<br />
objects in the signature dictionary, ByteRange and Contents, will need to be overwritten<br />
during the DSFinishSignProc callback.<br />
Parameters<br />
pdDoc<br />
sigData<br />
sigField<br />
sigAnnot<br />
offsetArray<br />
The document being signed.<br />
<strong>Signature</strong> data, as defined by the specific signature plug-in.<br />
<strong>Signature</strong> field.<br />
Cos object of the signature annotation.<br />
(Optional) An offset array pointing to a set of “marked” Cos objects<br />
that the signature type cares about; this array includes at least the<br />
ByteRange and Contents value objects.<br />
arrayCount<br />
(Optional) Number of objects in offsetArray, if used<br />
Return Value<br />
true if the signature was successfully placed in pdDoc, false otherwise.<br />
Header File<br />
DigSigHFT.h<br />
Related Callbacks<br />
DSFinishSignProc<br />
DSNewSigDataProc<br />
192 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Callbacks<br />
6<br />
DSDefaultValueProc<br />
Description<br />
Parameters<br />
ACCB1 void ACCB2 DSDefaultValueProc (PDDoc pdDoc,<br />
CosObj sigField, CosObj sigAnnot);<br />
N OTE: Deprecated in <strong>Acrobat</strong> 6.0.<br />
Callback for DigSigHandler. Called when a new signature field is created. This method<br />
creates the default signature value dictionary and creates a default value (DV) entry in the<br />
signature field dictionary pointing to this dictionary.<br />
pdDoc<br />
sigField<br />
sigAnnot<br />
The document being signed.<br />
<strong>Signature</strong> field.<br />
Cos object of the signature annotation.<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 193
6<br />
<strong>Digital</strong> <strong>Signature</strong> Callbacks<br />
DSDocCloseProc<br />
ACCB1 void ACCB2 DSDocCloseProc (PDDoc pdDoc);<br />
Description<br />
Callback for DigSigHandler. Called when a new document is closed.<br />
Parameters<br />
pdDoc<br />
The document being closed.<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Callbacks<br />
DSDocOpenProc<br />
194 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Callbacks<br />
6<br />
DSDocOpenProc<br />
ACCB1 void ACCB2* DSDocOpenProc (PDDoc pdDoc);<br />
Description<br />
Callback for DigSigHandler. Called when a new document is opened.<br />
Parameters<br />
pdDoc<br />
The document that has been opened.<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Callbacks<br />
DSDocCloseProc<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 195
6<br />
<strong>Digital</strong> <strong>Signature</strong> Callbacks<br />
DSFinishSignProc<br />
ACCB1 ASBool ACCB2 DSFinishSignProc (PDDoc pdDoc,<br />
void* sigData, CosObj sigField, CosObj sigAnnot,<br />
DigSigOffset offsetArray, ASInt32 arrayCount);<br />
Description<br />
Callback for DigSigHandler. Called to calculate checksum and update disk copy of<br />
document. May use information from the offsetArray parameter.<br />
Parameters<br />
pdDoc<br />
sigData<br />
sigField<br />
sigAnnot<br />
offsetArray<br />
arrayCount<br />
The document being signed.<br />
<strong>Signature</strong> data, as defined by the specific signature plug-in.<br />
<strong>Signature</strong> field.<br />
Cos object of the signature annotation.<br />
(Optional) An offset array pointing to a set of “marked” Cos objects<br />
that the signature type cares about; this array includes at least the<br />
ByteRange and Contents value objects.<br />
(Optional) Number of objects in offsetArray, if used<br />
Return Value<br />
true if processing successful, false otherwise.<br />
Header File<br />
DigSigHFT.h<br />
Related Callbacks<br />
DSClearSigProc<br />
Related Methods<br />
DigSigOverwriteHexstring<br />
DigSigOverwriteIntArray<br />
196 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Callbacks<br />
6<br />
DSFreeSigDataProc<br />
ACCB1 void ACCB2 DSFreeSigDataProc (void* sigData);<br />
Description<br />
Callback for DigSigHandler. Frees signature data.<br />
Parameters<br />
sigData<br />
<strong>Signature</strong> data, as defined by the specific signature plug-in. The handler<br />
should check to see if sigData is NULL.<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 197
6<br />
<strong>Digital</strong> <strong>Signature</strong> Callbacks<br />
DSGetBoolPropertyProc<br />
ACCB1 ASBool (ACCB2 *DSGetBoolPropertyProc)<br />
(ASAtom filter, DSHandlerProperty property);<br />
Description<br />
Get the boolean value of a DigSig handler property. Return true for those properties that<br />
represent functionality your handler supports, false if it does not support the<br />
functionality. (Some properties are available directly from the DigSigHandler.)<br />
Parameters<br />
filter<br />
property<br />
The name (filterKey value) of the handler from which the property is<br />
obtained.<br />
The property whose value is obtained.<br />
Return Value<br />
The property value, true or false.<br />
Header File<br />
DigSigHFT.h<br />
198 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Callbacks<br />
6<br />
DSGetSigPropProc<br />
ACCB1 ASCab (ACCB2 *DSGetSigPropProc)<br />
(PDDoc pdDoc, CosObj sigField, CosObj sigAnnot,<br />
ASAtom handlerName);<br />
Description<br />
Called to obtain an ASCab containing values that the handler wants DigSig to use in the UI.<br />
This is called only after the handler is called to validate the signature.<br />
Parameters<br />
pdDoc<br />
sigField<br />
sigAnnot<br />
handlerName<br />
The document being signed.<br />
<strong>Signature</strong> field.<br />
Cos object of the signature annotation.<br />
The name of the handler that is being asked to return the data. This<br />
is not necessarly the same as the value of the /Filter attribute in the<br />
signature dictionary.<br />
Return Value<br />
An ASCab object containing the properties. For a list of properties, see DigSigHFT.h.<br />
Header File<br />
DigSigHFT.h<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 199
6<br />
<strong>Digital</strong> <strong>Signature</strong> Callbacks<br />
DSGetStatusTextProc<br />
ASText DSGetStatusTextProc (PDDoc pdDoc, CosObj sigField,<br />
CosObj sigAnnot);<br />
Description<br />
Return a string describing the status of the signature. Must be PDDocEncoding or<br />
unicode, where unicode strings must start with 0xFE, 0xFF.<br />
N OTE:<br />
Superceded by DSGetSigPropProc in <strong>Acrobat</strong> 6.0, which provides better<br />
granularity for signature status.<br />
Parameters<br />
pdDoc<br />
sigField<br />
sigAnnot<br />
The document being signed.<br />
<strong>Signature</strong> field.<br />
Cos object of the signature annotation.<br />
Return Value<br />
None.<br />
Header File<br />
DigSigHFT.h<br />
200 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Callbacks<br />
6<br />
DSGetValidStateProc<br />
ACCB1 DSValidState ACCB2 DSGetValidStateProc (PDDoc pdDoc,<br />
CosObj sigField, CosObj sigAnnot);<br />
Description<br />
Callback for DigSigHandler. Called by signature panel display to choose which of the<br />
double-checked, pass, fail, unknown, or blank icons to show. May call<br />
DigSigUpdatePanel to update the signature panel.<br />
Parameters<br />
pdDoc<br />
sigField<br />
sigAnnot<br />
The document being signed.<br />
<strong>Signature</strong> field.<br />
Cos object of the signature annotation.<br />
Enumerations<br />
DSSigBlank<br />
DSSigUnknown<br />
DSSigInValid<br />
DSSigValid<br />
DSSigDoubleChecked<br />
The signature field is unsigned.<br />
The signature field is signed but not validated.<br />
The signature field is signed but invalid.<br />
The signature field is signed and valid.<br />
The signature field is signed and double-checked valid.<br />
Return Value<br />
Validation state.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigUpdatePanel<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 201
6<br />
<strong>Digital</strong> <strong>Signature</strong> Callbacks<br />
DSNewSigDataProc<br />
Description<br />
Parameters<br />
ACCB1 ASBool ACCB2 DSNewSigDataProc (PDDoc pdDoc,<br />
DigSigBBox bb, void** sigData, CosObj sigField,<br />
CosObj sigAnnot);<br />
N OTE: Superceded in <strong>Acrobat</strong> 6.0 by DSNewSigDataWithParamsProc.<br />
Callback for DigSigHandler. Called to gather signature data or to cancel. May display<br />
dialogs. May use the default value (DV) field of the signature field if it is not CosNull.<br />
To allow for a user to cancel signing, the handler should not modify the document during<br />
this callback. The handler will commit the signature to the PDF file during<br />
DSClearSigProc.<br />
pdDoc<br />
bb<br />
sigData<br />
sigField<br />
sigAnnot<br />
The document being signed.<br />
<strong>Signature</strong> annotation bounding box.<br />
<strong>Signature</strong> data, as defined by the specific signature plug-in.<br />
<strong>Signature</strong> field.<br />
Cos object of the signature annotation.<br />
Return Value<br />
true if signature data gathered, false if canceled.<br />
Header File<br />
DigSigHFT.h<br />
Related Callbacks<br />
DSClearSigProc<br />
DSNewSigDataWithParamsProc<br />
DSFinishSignProc<br />
DSFreeSigDataProc<br />
202 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Callbacks<br />
6<br />
DSNewSigDataWithParamsProc<br />
Description<br />
Parameters<br />
ACCB1 DSSaveType ACCB2 DSNewSigDataProc<br />
(DigSigNewSigDataParams sigParams, void** sigData);<br />
N OTE: Supercedes DSNewSigDataProc in <strong>Acrobat</strong> 6.0.<br />
Callback for DigSigHandler. Creates new signature data to be used by Commit and<br />
Finish, then destroyed by DSFreeSigDataProc.<br />
If a dialog is not used (bUI in parameters is false) then exception strings are stored in the<br />
signature data, and can be retrieved with DSSigDataGetErrorTextProc.<br />
sigParams<br />
sigData<br />
The structure containing signing parameters.<br />
(Filled by the method) <strong>Signature</strong> data, as defined by the specific<br />
signature plug-in.<br />
Return Value<br />
A constant indicating the action to be performed on the document; cancel signing, save to<br />
the same filename, or save to a new filename.<br />
Header File<br />
DigSigHFT.h<br />
Related Callbacks<br />
DSCommitSignProc<br />
DSNewSigDataProc<br />
DSFinishSignProc<br />
DSFreeSigDataProc<br />
DSSigDataGetErrorTextProc<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 203
6<br />
<strong>Digital</strong> <strong>Signature</strong> Callbacks<br />
DSNotificationProc<br />
ACCB1 void (ACCB2 *DSNotificationProc)(void *info,<br />
void *clientData);<br />
Description<br />
Callback for the Notification Server. Called when a digital signature event occurs for which<br />
you have registered an interest. This procedure is called for these events:<br />
● Adding or deleting a signature field.<br />
● Requesting a new signature, and the success of the request.<br />
● Requesting that an existing signature be cleared, and the success of the request.<br />
For failure events, the server calls the DSNotificationFailureProc.<br />
Parameters<br />
info<br />
clientData<br />
Pointer to a DSNotifyParams structure containing information<br />
about the event.<br />
Pointer to user-supplied data to pass to proc each time it is called.<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Callbacks<br />
DSNotificationFailureProc<br />
Related Methods<br />
DigSigRegisterObserver<br />
204 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Callbacks<br />
6<br />
DSNotificationFailureProc<br />
ACCB1 void (ACCB2 *DSNotificationFailureProc)(ASInt32 error,<br />
void *info, void *clientData);<br />
Description<br />
Callback for the Notification Server. Called when a digital signature event occurs for which<br />
you have registered an interest. This procedure is called for these events:<br />
● The failure of a request for a new signature.<br />
● The failure of a request for an existing signatureto be cleared.<br />
For field change, request, and success events, the server calls the<br />
DSNotificationProc.<br />
Parameters<br />
error<br />
info<br />
clientData<br />
The error code for the error that occured.<br />
Pointer to a DSNotifyParams structure containing information<br />
about the event.<br />
Pointer to user-supplied data to pass to proc each time it is called.<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Callbacks<br />
DSNotificationProc<br />
Related Methods<br />
DigSigRegisterObserver<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 205
6<br />
<strong>Digital</strong> <strong>Signature</strong> Callbacks<br />
DSPropertiesProc<br />
Description<br />
Parameters<br />
ACCB1 void ACCB2 DSPropertiesProc (PDDoc pdDoc,<br />
CosObj sigField, CosObj sigAnnot);<br />
N OTE: Superceded by DSPropertiesExProc in <strong>Acrobat</strong> 6.0.<br />
Callback for DigSigHandler. Called when a user selects a signature and asks for its<br />
properties. The handler should present its own dialog that provides details concerning the<br />
signature and its validation state.<br />
pdDoc<br />
sigField<br />
sigAnnot<br />
The document being signed.<br />
<strong>Signature</strong> field.<br />
Cos object of the signature annotation.<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigUpdatePanel<br />
206 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Callbacks<br />
6<br />
DSPropertiesExProc<br />
Description<br />
Parameters<br />
ACCB1 void ACCB2 DSPropertiesExProc (PDDoc pdDoc,<br />
CosObj sigField, CosObj sigAnnot, ASAtom handlerName,<br />
ESObject sigEngine);<br />
N OTE: Supercedes DSPropertiesProc in <strong>Acrobat</strong> 6.0.<br />
Callback for DigSigHandler. Called when a user selects a signature and asks for its<br />
properties. Brings up the properties dialog for the signature.<br />
pdDoc<br />
sigField<br />
sigAnnot<br />
handlerName<br />
sigEngine<br />
The document being signed.<br />
<strong>Signature</strong> field.<br />
Cos object of the signature annotation.<br />
The sub-handler to use to validate, in the event that the handler has<br />
more then one sub-handler (as is the case with PubSec), and the<br />
handler is being asked to validate a signature that has a different<br />
filter name then its own.<br />
Used internally.<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigUpdatePanel<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 207
6<br />
<strong>Digital</strong> <strong>Signature</strong> Callbacks<br />
DSReValidateSigProc<br />
ACCB1 void ACCB2 DSReValidateSigProc (PDDoc pdDoc,<br />
CosObj sigField, CosObj sigAnnot);<br />
Description<br />
Callback for DigSigHandler. <strong>Acrobat</strong> will call this to optionally change appearance key<br />
(AP) back to the state it had just before the prior call (if any) to DSUnValidateSigProc.<br />
Call DSUnValidateSigProc on every signature field just before saving a document and<br />
call DSReValidateSigProc just after. The intended effect is that saved documents<br />
always have signed signature appearances of unknown validity (question mark), but that<br />
saving does not necessarily change the onscreen appearance of validated signatures.<br />
Parameters<br />
pdDoc<br />
sigField<br />
sigAnnot<br />
The document being signed.<br />
<strong>Signature</strong> field.<br />
Cos object of the signature annotation.<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Callbacks<br />
DSUnValidateSigProc<br />
208 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Callbacks<br />
6<br />
DSSigDataGetErrorTextProc<br />
ACCB1 ASText (ACCB2 *DSSigDataGetErrorTextProc)<br />
(void *sigData);<br />
Description<br />
Returns an error string to describe failure during new, commit, or free steps. If not NULL,<br />
then a JavaScript general exception is thrown using this string.<br />
The handler can set this procedure to NULL if desired.<br />
The string is owned by sigData, so should be freed by DSFreeSigDataProc.<br />
Parameters<br />
sigData<br />
A pointer to the signature for which the error string is obtained.<br />
Return Value<br />
The error string as an ASText.<br />
Header File<br />
DigSigHFT.h<br />
Related Callbacks<br />
DSFreeSigDataProc<br />
DSNewSigDataWithParamsProc<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 209
6<br />
<strong>Digital</strong> <strong>Signature</strong> Callbacks<br />
DSUnValidateSigProc<br />
ACCB1 void ACCB2 DSUnValidateSigProc (PDDoc pdDoc,<br />
CosObj sigField, CosDoc sigAnnot);<br />
Description<br />
Callback for DigSigHandler. Called to change appearance key (AP) back to appearance<br />
that is used for the unvalidated state.<br />
Parameters<br />
pdDoc<br />
sigField<br />
sigAnnot<br />
The document being signed.<br />
<strong>Signature</strong> field.<br />
Cos object of the signature annotation.<br />
Return Value<br />
None<br />
Header File<br />
DigSigHFT.h<br />
Related Callbacks<br />
DSValidateSigProc<br />
DSReValidateSigProc<br />
Related Methods<br />
DigSigGetStdXObj<br />
Related Methods<br />
DigSigFileGetEOF<br />
DigSigMD5ByteRange<br />
DigSigFileRead<br />
DigSigFileSetPos<br />
210 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Callbacks<br />
6<br />
DSValidateSigProc<br />
ACCB1 DSValidState ACCB2 DSValidateSigProc (PDDoc pdDoc,<br />
CosObj sigField, CosObj sigAnnot);<br />
Description<br />
Callback for DigSigHandler. Called to validate a signature. Recalculates any document<br />
digest that it desires, possibly using the DigSigFileGetEOF, DigSigMD5ByteRange,<br />
DigSigFileRead, and DigSigFileSetPos methods.<br />
May compare this result to the stored one, and do any other signature-specific checks<br />
desired. Optionally does a validation against a stored (network) registry. If necessary,<br />
updates the AP dictionary in the signature annotation dictionary to show the validation<br />
state of the signature.<br />
Parameters<br />
pdDoc<br />
sigField<br />
sigAnnot<br />
The document being signed.<br />
<strong>Signature</strong> field.<br />
Cos object of the signature annotation.<br />
Return Value<br />
Validation state.<br />
Header File<br />
DigSigHFT.h<br />
Related Callbacks<br />
DSUnValidateSigProc<br />
DSReValidateSigProc<br />
Related Methods<br />
DigSigFileGetEOF<br />
DigSigMD5ByteRange<br />
DigSigFileRead<br />
DigSigFileSetPos<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 211
6<br />
<strong>Digital</strong> <strong>Signature</strong> Callbacks<br />
212 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Callbacks<br />
6<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 213
6<br />
<strong>Digital</strong> <strong>Signature</strong> Callbacks<br />
214 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
7<br />
<strong>Digital</strong> <strong>Signature</strong> Declarations<br />
DigSigBBox<br />
typedef struct _t_DigSigBBoxRec* DigSigBBox;<br />
typedef struct _t_DigSigBBoxRec<br />
{<br />
Fixed bbWidth;<br />
Fixed bbHeight;<br />
}<br />
DigSigBBoxRec;<br />
Description<br />
<strong>Signature</strong> annotation bounding box.<br />
Members<br />
bbwidth<br />
bbHeight<br />
The width of the signature bounding box.<br />
The height of the signature bounding box.<br />
Header File<br />
DigSigHFT.h<br />
Related Callbacks<br />
DSNewSigDataProc<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 215
7<br />
<strong>Digital</strong> <strong>Signature</strong> Declarations<br />
DigSigHandler<br />
typedef struct _t_DigSigHandlerRec* DigSigHandler;<br />
typedef struct _t_DigSigHandlerRec<br />
{<br />
ASSize_t size;<br />
const char* uiName;<br />
ASAtom filterKey;<br />
ASBool canBlindSign;<br />
ASBool canEncrypt;<br />
DSDocOpenProc dsDocOpen;<br />
DSDocCloseProc dsDocClose;<br />
DSDefaultValueProc dsDefaultValue;<br />
DSNewSigDataProc dsNewSigData;<br />
DSClearSigProc dsCommitSign;<br />
DSFinishSignProc dsFinishSign;<br />
DSFreeSigDataProc dsFreeSigData; */<br />
DSValidateSigProc dsValidateSig;<br />
DSGetValidStateProc dsGetValidState;<br />
DSPropertiesProc dsProperties;<br />
DSUnValidateSigProc dsUnValidateSig;<br />
DSReValidateSigProc dsReValidateSig;<br />
/* New in <strong>Acrobat</strong> 5.0 */<br />
DSClearSigProc dsClearSig;<br />
DSGetStatusTextProc dsStatusText;<br />
DSNewSigDataExProc dsNewSigDataEx; /* internal */<br />
DSValidateSigExProc dsValidateSigEx; /* internal */<br />
DSGetSigInfoProc dsGetSigInfo; /* internal */<br />
DSNewSigEngineProc dsNewSigEngine; /* not used */<br />
DSSigDataGetErrorTextProc dsSigDataGetErrorText;<br />
/* New in <strong>Acrobat</strong> 6.0 */<br />
DSNewSigDataWithParamsProc dsNewSigDataWithParams;<br />
DSPropertiesExProc dsPropertiesEx;<br />
DSCosDocSigSignProc dsCosDocSigSign; /*internal*/<br />
DSCosDocSigValidateProc dsCosDocSigValidate; /*internal*/<br />
DSDataBufferSigSignProc dsDataBufferSigSign;/*internal*/<br />
DSDataBufferSigValidateProc dsDataBufferSigValidate;<br />
/*internal*/<br />
DSCanValidateProc dsCanValidate;<br />
DSGetSigSeedValueProc dsGetSigSeedValue; /* internal */<br />
DSSetSigSeedValueProc dsSetSigSeedValue; /* internal */<br />
DSGetBoolPropertyProc dsGetBoolProperty;<br />
DSGetSigPropProc dsGetSigProp;<br />
}<br />
DigSigHandlerRec;<br />
Description<br />
Data structure containing callbacks that define a signature plug-in’s behavior.<br />
216 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Declarations<br />
7<br />
Members<br />
size<br />
uiName<br />
filterKey<br />
canBindSign<br />
canEncrypt<br />
dsDocOpen<br />
dsDocClose<br />
Size of the data structure. Must be set to<br />
sizeof(DigSigHandlerRec).<br />
Language-dependent name to show for signature<br />
type selection.<br />
The value of the Filter key in the signature<br />
dictionary.<br />
true if this signature type can do no-appearance<br />
signatures, false otherwise.<br />
true if this signature type can do encrypt-and-sign,<br />
false otherwise.<br />
Called when a new document is opened.<br />
Called when a new document is closed.<br />
dsDefaultValue Called when a new signature field is created.<br />
dsNewSigData<br />
dsCommitSign<br />
dsFinishSign<br />
dsFreeSigData<br />
dsGetValidState<br />
dsProperties<br />
dsUnValidateSig<br />
dsReValidateSig<br />
dsClearSig<br />
dsStatusText<br />
dsNewSigDataEx<br />
dsValidateSigEx<br />
dsGetSigInfo<br />
dsNewSigEngine<br />
Called to gather signature or cancel.<br />
Called to put signature into doc or cancel.<br />
Called to calculate checksum and overwrite.<br />
Called to free signature data.<br />
Called by sig panel display.<br />
Called by sig panel display.<br />
Called to change AP back to unvalidated.<br />
Called to change AP back to whatever it was.<br />
Notification that signature has been cleared.<br />
Called to get a string describing status.<br />
Used internally in <strong>Acrobat</strong> 5.0. Superceded in<br />
<strong>Acrobat</strong> 6.0 by dsNewSigDataWithParams.<br />
Used internally by PubSec.<br />
Used internally by EScript in <strong>Acrobat</strong> 5.0. No longer<br />
used.<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 217
7<br />
<strong>Digital</strong> <strong>Signature</strong> Declarations<br />
dsSigDataGetErrorText<br />
dsNewSigDataWithParams<br />
dsPropertiesEx<br />
dsCosDocSigSign<br />
dsCosDocSigValidate<br />
dsDataBufferSigSign<br />
dsDataBufferSigValidate<br />
dsCanValidate<br />
dsGetSigSeedValue<br />
dsSetSigSeedValue<br />
dsGetBoolProperty<br />
dsGetSigProp<br />
Called to get a descriptive string for an error during<br />
new, commit, or free steps.<br />
Called to create new signature data to be used by<br />
Commit and Finish. Supercedes ds<br />
Called to show the signature properties dialog for<br />
the signature.<br />
For internal use only.<br />
Called to determine whether handler can validate a<br />
PDDoc field signature.<br />
Used internally by PubSec.<br />
Called to test whether your handler supports specific<br />
functionality.<br />
Called to get an ASCab containing signature<br />
properties to be used in the UI.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigRegisterFilter<br />
218 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Declarations<br />
7<br />
DigSigNewSigDataParams<br />
typedef struct _t_DigSigNewSigDataParamsRec {<br />
ASSize_t size;<br />
PDDoc pdDoc;<br />
CosObj sigField;<br />
CosObj sigAnnot;<br />
DigSigBBox bb;<br />
ASAtom filter;<br />
ESObject esSigEngine; /*internal*/<br />
ESObject esSigParams; /*internal*/<br />
ASText esErrorText;<br />
ASBool bUI;<br />
ASBool bDocAuthSig;<br />
CosObj legalPDFDict;<br />
DSMDPType mdpSetting;<br />
} DigSigNewSigDataParamsRec, *DigSigNewSigDataParams;<br />
Description<br />
Parameters for DSNewSigDataWithParamsProc.<br />
Members<br />
size<br />
pdDoc<br />
sigField<br />
sigAnnot<br />
bb<br />
filter<br />
esSigEngine<br />
esSigParams<br />
esErrorText<br />
bUI<br />
bDocAuthSig<br />
Size of the data structure. Must be set to<br />
sizeof(DigSigNewSigDataParamsRec).<br />
The PDF document that is being signed.<br />
<strong>Signature</strong> form field that is being signed.<br />
<strong>Signature</strong> annotation that is being signed (usually equivalent to<br />
sigField).<br />
Bounding box of signature appearance.<br />
Name of the selected handler to use when signing.<br />
Used internally.<br />
If true, prompt to sign, otherwise silent. (Can be true with<br />
Escript.)<br />
When true, signing a document author signature.<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 219
7<br />
<strong>Digital</strong> <strong>Signature</strong> Declarations<br />
legalPDFDict<br />
mdpSetting<br />
Legal PDF scrubber warnings, populated only when signing a<br />
document author signature.<br />
Modification, detection, and prevention (MDP) setting, populated<br />
only when signing a document author signature. One of:<br />
● kDSMDPAllowAll: Allow all changes (disables MDP).<br />
● kDSMDPAllowNone: Allow no changes.<br />
● kDSMDPDefault: Allow only "natural" changes (form-field<br />
filling, page spawning).<br />
● kDSMDPCommentsAndDefault: Allow all comment types<br />
edit/modify/delete, in addition to default changes.<br />
Header File<br />
DigSigHFT.h<br />
Related Callbacks<br />
DSNewSigDataWithParamsProc<br />
220 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Declarations<br />
7<br />
DigSigOffset<br />
DigSigOffsetRec<br />
typedef struct _t_DigSigOffsetRec* DigSigOffset;<br />
typedef struct _t_DigSigOffsetRec<br />
{<br />
CosObj cosObj;<br />
ASInt32 byteOffset;<br />
ASInt32 byteLength;<br />
}<br />
DigSigOffsetRec;<br />
Description<br />
Structure that indicates the location of objects in a saved PDF document.<br />
Members<br />
cosObj<br />
byteOffset<br />
byteLength<br />
The CosObj whose byte offset/length is desired.<br />
Byte offset in saved PDF file.<br />
Length in saved PDF file.<br />
Header File<br />
DigSigHFT.h<br />
Related Callbacks<br />
DSClearSigProc<br />
DSFinishSignProc<br />
Related Methods<br />
DigSigCosObjOverwrite<br />
DigSigOverwriteBytes<br />
DigSigOverwriteHexstring<br />
DigSigOverwriteIntArray<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 221
7<br />
<strong>Digital</strong> <strong>Signature</strong> Declarations<br />
DSAPCreateLayeredStreamExParams<br />
typedef struct _t_DSAPCreateLayeredStreamExParams<br />
{<br />
CosDoc cosDoc;<br />
CosObj* XObjects;<br />
ASFixedMatrixP layerMatrices;<br />
ASInt32 numXObjects;<br />
ASInt16 layerNNum;<br />
AFPDWidgetBorder border;<br />
PDColorValue cBorder;<br />
PDColorValue cBackGnd;<br />
ASFixed width;<br />
ASFixed height;<br />
PDRotate pdr;<br />
ASBool* layerFlags;<br />
} DSAPCreateLayeredStreamExParamsRec,<br />
*DSAPCreateLayeredStreamExParams;<br />
Description<br />
Parameter structure for DigSigAPCreateLayeredStreamEx, that creates a stream<br />
that is composed of either four or five layers, as specified by layerMatrices:<br />
● layer 0: background, inherited from form annot background<br />
● layer 1: middle, question mark or equivalent (uses the default if the corresponding<br />
XObject is CosNull)<br />
● layer 2: main, text and appearance (must be provided)<br />
● layer 3: top, blank or X (uses the default if the layer1 XObject is CosNull)<br />
● layer N: optional very top layer, used for text showing validity state (none if CosNull)<br />
Members<br />
cosDoc<br />
XObjects<br />
layerMatrices<br />
numXObjects<br />
layerNNum<br />
border<br />
The document in which to include the standard XObject.<br />
A pointer to an array of XObjects for the appearance layers.<br />
A pointer to an array of positions corresponding to the layers in<br />
XObjects.<br />
The size of the XObjects array.<br />
The layer number for the optional validity state layer.<br />
The border from AFPDWidgetGetBorder.<br />
222 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Declarations<br />
7<br />
cBorder<br />
cBackGnd<br />
width<br />
height<br />
pdr<br />
layerFlags<br />
The color of the border.<br />
color of the background.<br />
The width of the new stream object.<br />
The height of the new stream object.<br />
The rotational parameter from AFPDWidgerGetRotation.<br />
An array of flag values corresponding to the layers specified by<br />
XObject. A value of true means that the corresponding layer is<br />
displayed.<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 223
7<br />
<strong>Digital</strong> <strong>Signature</strong> Declarations<br />
DSAPTextEntry<br />
typedef struct _t_DSAPTextEntryRec {<br />
struct _t_DSAPTextEntryRec *next;<br />
ASFixed heightRatio;<br />
ASText text;<br />
} DSAPTextEntryRec, *DSAPTextEntry;<br />
Description<br />
A linked list of text items to be merged together in a signature appearance XObject.<br />
Members<br />
next<br />
heightRation<br />
text<br />
Next list entry, or NULL if last entry.<br />
Ration of the text height to the overall height of the bounding box.<br />
0x00010000 is 100%<br />
The text to render in this object. The caller owns this memory.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DSAPCreateCompositeTextXObj<br />
224 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Declarations<br />
7<br />
DSAPXObjEntry<br />
DSAPXObjEntryRec<br />
typedef struct _t_DSAPXObjEntryRec{<br />
struct _t_DSAPXObjEntryRec * next;<br />
CosObj xobj;<br />
ASFixedRect rect;<br />
const char* text;<br />
ASInt 32 textLen;<br />
ASFixed textSize;<br />
DSQuadding xjustify;<br />
DSQuadding yjustify;<br />
ASFixed scale;<br />
ASBool bMerge;<br />
ASBool bDestroy;<br />
} DSAPXObjEntryRec, *DSAPXObjEntry;<br />
Description<br />
Structure used in DigSigAPXObjectFromXObjList.<br />
Members<br />
next<br />
xobj<br />
rect<br />
text<br />
textLen<br />
textSize<br />
xjustify<br />
yjustify<br />
scale<br />
bMerge<br />
bDestroy<br />
Next list entry.<br />
If not null, use this Xobject as entry.<br />
Rect relative to bbox in which to render object.<br />
If not empty, render this string (can contain new lines).<br />
Text length.<br />
Font size; 0 for automatic.<br />
Justification of xobj (not all options supported).<br />
Justification of xobj (not all options supported).<br />
Scale Xobject within rect.<br />
If true and xobj is Subtype Xobject then xobj is merged up.<br />
if true, destroy xobj after merge.<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 225
7<br />
<strong>Digital</strong> <strong>Signature</strong> Declarations<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigAPXObjectFromXObjList<br />
226 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Declarations<br />
7<br />
DSComparePagesParams<br />
typedef struct _t_DSComparePagesParamsRec {<br />
ASSize_t size;<br />
ASInt32 sensitivityLevel;<br />
} DSComparePagesParamsRec, *DSComparePagesParams;<br />
Description<br />
Parameters for page comparison.<br />
Members<br />
size<br />
sensitivityLevel<br />
Size of the data structure. Must be set to<br />
sizeof(DSComparePagesParamsRec).<br />
The sensitivity level for the comparison. The DPI determines<br />
the resolution at which each page is rendered before<br />
comparing on a pixel-by-pixel basis. Values are:<br />
0: 72 DPI<br />
1: 36 DPI<br />
2: 18 DPI<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigComparePagesEx<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 227
7<br />
<strong>Digital</strong> <strong>Signature</strong> Declarations<br />
DSCompareWordsParams<br />
typedef struct _t_DSCompareWordsParamsRec {<br />
ASSize_t size;<br />
ASBool useFont;<br />
} DSCompareWordsParamsRec, *DSCompareWordsParams;<br />
Description<br />
Parameters for page comparison.<br />
Members<br />
size<br />
useFont<br />
Size of the data structure. Must be set to<br />
sizeof(DSCompareWordsParamsRec).<br />
If true, the font name, size, and color of each character in a word are<br />
considered when matching against other words. If false, these<br />
attributes are ignored.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigCompareWordsEx<br />
228 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Declarations<br />
7<br />
DSHandlerProperty<br />
typedef enum {<br />
kDSHandlerCanDocAuthSign=0,<br />
kDSHandlerCanDocPDDocSignVisible,<br />
kDSHandlerEScriptAware,<br />
kDSHandlerPropEnumSize<br />
} DSHandlerProperty;<br />
Description<br />
Boolean properties of a DigSigHandler, obtained with DSGetBoolPropertyProc,<br />
that show whether the handler supports specific functionality.<br />
Values<br />
kDSHandlerCanDocAuthSign<br />
kDSHandlerCanDocPDDocSignVisible<br />
kDSHandlerEScriptAware<br />
When true, the handler supports<br />
author signatures.<br />
When true, the handler supports<br />
ordinary visible signatures.<br />
When true, the handler supports<br />
EScript.<br />
Related Callbacks<br />
DSGetBoolPropertyProc<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 229
7<br />
<strong>Digital</strong> <strong>Signature</strong> Declarations<br />
DSMDPType<br />
typedef enum {<br />
kDSMDPNone = -1,<br />
kDSMDPAllowAll=0,<br />
kDSMDPAllowNone,<br />
kDSMDPDefault,<br />
kDSMDPCommentsAndDefault,<br />
kDSMDPEnumSize<br />
} DSMDPType;<br />
Description<br />
The modification detection and prevention (MDP) value for an author signature.<br />
Members<br />
kDSMDPNone<br />
kDSMDPAllowAll<br />
kDSMDPAllowNone<br />
kDSMDPDefault<br />
kDSMDPCommentsAndDefault<br />
No MDP, or the document does not have an author<br />
signature.<br />
Allow any changes (this disables the MDP feature).<br />
Allow no changes.<br />
Only allow 'natural' changes ( form field fill-in,<br />
page spawning).<br />
Allow all comment types, edit, modify, and delete<br />
operationa, in addition to default changes.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigGetDocMDPSetting<br />
230 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Declarations<br />
7<br />
DSNotificationType<br />
typedef enum {<br />
DSSigAdded = 0,<br />
DSSigDeleted,<br />
DSWillSign,<br />
DSDidSign,<br />
DSFailSign,<br />
DSWillVerify, /*new in <strong>Acrobat</strong> 6.0*/<br />
DSDidVerify, /*new in <strong>Acrobat</strong> 6.0*/<br />
DSFailVerify, /*new in <strong>Acrobat</strong> 6.0*/<br />
DSWillClear,<br />
DSDidClear,<br />
DSFailClear,<br />
DigSigNumNotifications<br />
} DSNotificationType;<br />
Description<br />
A type of notification to register for.<br />
Members<br />
DSSigAdded<br />
DSSigDeleted<br />
DSWillSign<br />
DSDidSign<br />
DSFailSign<br />
DSWillVerify<br />
DSDidVerify<br />
DSFailVerify<br />
DSWillClear<br />
DSDidClear<br />
DSFailClear<br />
<strong>Signature</strong> field is added.<br />
<strong>Signature</strong> field is deleted.<br />
A signature is requested. (That is, the notification procedure is<br />
invoked before the signature is applied.)<br />
A signature is created. (That is, the notification procedure is<br />
invoked when signing succeeds.)<br />
A signature request fails. (That is, the notification procedure is<br />
invoked when signing fails.)<br />
A signature verification is requested.<br />
A signature verification succeeds.<br />
A signature verification request fails.<br />
The clearing of a signature is requested.<br />
The clearing of a signature succeeds.<br />
The clearing of a signature fails.<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 231
7<br />
<strong>Digital</strong> <strong>Signature</strong> Declarations<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigRegisterObserver<br />
232 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Declarations<br />
7<br />
DSNotifyParams<br />
typedef struct _t_DSNtfyParamsRec {<br />
ASSize_t size;<br />
DSNotificationType notificationID;<br />
PDDoc pdDoc;<br />
CosDoc cosDoc;<br />
CosObj sigField;<br />
CosObj sigDict;<br />
} DSNtfyParamsRec, *DSNtfyParams;<br />
Description<br />
A structure passed to the callback when a digital signature event occurs for which an<br />
interest has been registered. The structure contains information about the event.<br />
Members<br />
size<br />
notificationID<br />
pdDoc<br />
cosDoc<br />
sigField<br />
sigDict<br />
Size of the data structure. Must be set to<br />
sizeof(DSNotifyParamsRec).<br />
The event that occurred.<br />
The PDF document for which the event occurred.<br />
The Cos document containing the object for which the event<br />
occurred.<br />
The signature field for which the event occurred.<br />
The signature dictionary (used only for the events DSDidSign<br />
and DSDidClear).<br />
Header File<br />
DigSigHFT.h<br />
Related Callbacks<br />
DSNotificationProc<br />
DSNotificationFailureProc<br />
Related Methods<br />
DigSigRegisterObserver<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 233
7<br />
<strong>Digital</strong> <strong>Signature</strong> Declarations<br />
DSOverwriteType<br />
typedef enum {<br />
DSOverwriteStringHex=0,<br />
DSOverwriteStringBase64,<br />
DSOverwriteArray,<br />
DSOverwriteEnumSize<br />
} DSOverwriteType;<br />
Description<br />
Constant values that determine the type of Cos object overwrite to be performed.<br />
Members<br />
DSOverwriteStringHex Overwrite a hex-encoded CosString that uses <<br />
and > delimiters.<br />
DSOverwriteStringBase64<br />
Overwrite a base64-encoded CosString that<br />
uses ( and ) delimiters. All non-base64 characters in<br />
the overwrite string are ignored.<br />
DSOverwriteArray Overwrite a CosArray .<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigCosObjOverwrite<br />
234 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Declarations<br />
7<br />
DSQuadding<br />
typedef enum {<br />
DSLeftQ = 0,<br />
DSCenterQ,<br />
DSRightQ<br />
} DSQuadding;<br />
Description<br />
Justification of XObjects.<br />
Members<br />
DSLeftQ<br />
DSCenterQ<br />
DSRightQ<br />
left justification.<br />
center justification<br />
right justification<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigAPXObjectFromXObjList<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 235
7<br />
<strong>Digital</strong> <strong>Signature</strong> Declarations<br />
DSSigRefDictErrParams<br />
typedef struct _t_DSSigRefDictErrParamsRec {<br />
ASSize_t size;<br />
DSSigRefErrCode errCode;<br />
ASText errText;<br />
} DSSigRefDictErrParamsRec, *DSSigRefDictErrParams;<br />
Description<br />
A structure that contains information about exceptions that occurred in signature reference<br />
dictionary procedures.<br />
Members<br />
size<br />
errCode<br />
errText<br />
The size of this structure.<br />
The exception code.<br />
Text associated with the error code. If errCode is<br />
kDSSigRefErrMissingPlugin, the name of a software module.<br />
Must point to an initialized ASText object.<br />
Header File<br />
Related Methods<br />
DigSigHFT.h<br />
DigSigFinishSigRefDict<br />
DigSigNewSigRefDict<br />
DigSigVerifySigRefDict<br />
236 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Declarations<br />
7<br />
DSSigRefDictParams<br />
typedef struct _t_DSSigRefDictParamsRec {<br />
ASSize_t size;<br />
CosDoc cosDoc;<br />
CosObj rootObj;<br />
CosObj sigDict;<br />
ASAtom transformMethod;<br />
CosObj transformParams;<br />
ASBool bIndirect;<br />
} DSSigRefDictParamsRec, *DSSigRefDictParams;<br />
Description<br />
Parameters used by methods that create a signature reference dictionary. See Section 8.7,<br />
"<strong>Digital</strong> <strong>Signature</strong>s," in the PDF <strong>Reference</strong> for more information on signature reference<br />
dictionaries.<br />
Members<br />
size<br />
cosDoc<br />
rootObj<br />
sigDict<br />
transformMethod<br />
transformParams<br />
bIndirect<br />
Size of the data structure. Must be set to<br />
sizeof(DSSigRefDictParamsRec).<br />
The document containing the object to be signed.<br />
The root object to be signed.<br />
The signature dictionary that this reference dictionary will be<br />
part of.<br />
The transform method name. Possible values are DocMDP,<br />
FieldMDP, UR and Identity.<br />
The transform parameters, which are specific to each transform<br />
method.<br />
true if the dictionary should be indirect, false if it should be<br />
direct.<br />
Header File<br />
DigSigHFT.h<br />
Related Methods<br />
DigSigNewSigRefDict<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 237
7<br />
<strong>Digital</strong> <strong>Signature</strong> Declarations<br />
DSSigRefErrCode<br />
typedef enum {<br />
kDSSigRefErrNone=0,<br />
kDSSigRefErrMissingPlugin,<br />
kDSSigRefErrNewVersion,<br />
kDSSigRefErrOldVersion,<br />
kDSSigRefErrEnumSize<br />
} DSSigRefErrCode;<br />
Description<br />
Error constants for signature reference dictionary procedures.<br />
Values<br />
kDSSigRefErrMissingPlugin<br />
kDSSigRefErrNewVersion<br />
kDSSigRefErrOldVersion<br />
Missing required plug-in or software module.<br />
Software module is named by errText in<br />
DSSigRefDictErrParams.<br />
New unsupported version of signature.<br />
Old unsupported version of signature.<br />
Header File<br />
Related Methods<br />
DigSigHFT.h<br />
DigSigFinishSigRefDict<br />
DigSigNewSigRefDict<br />
DigSigVerifySigRefDict<br />
238 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
<strong>Digital</strong> <strong>Signature</strong> Declarations<br />
7<br />
DSValidState<br />
typedef enum {<br />
DSSigBlank=0,<br />
DSSigUnknown,<br />
DSSigInvalid,<br />
DSSigValid,<br />
DSSigDoubleChecked,<br />
DSSigValidStateEnumSize<br />
} DSValidState;<br />
Description<br />
A validity state constant for a signature field, resulting from verification.<br />
Values<br />
DSSigBlank<br />
DSSigUnknown<br />
DSSigInvalid<br />
DSSigValid<br />
DSSigDoubleChecked<br />
<strong>Signature</strong> field is unsigned.<br />
<strong>Signature</strong> field is signed, but not validated.<br />
<strong>Signature</strong> field is signed, but validation failed.<br />
<strong>Signature</strong> field is signed and valid.<br />
<strong>Signature</strong> field is signed and double-checked valid.<br />
Header File<br />
Related Methods<br />
DigSigHFT.h<br />
DigSigVerifySig<br />
Related Callbacks<br />
DSGetValidStateProc<br />
DSValidateSigProc<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 239
7<br />
<strong>Digital</strong> <strong>Signature</strong> Declarations<br />
DSXObjType<br />
typedef enum {<br />
DSBlankXObj,<br />
DSUnknownXObj,<br />
DSInvalidXObj,<br />
DSValidXObj,<br />
DSDoubleCheckedXObj<br />
} DSXObjType;<br />
Description<br />
Structure describing the appearance of a digital signature.<br />
Members<br />
DSBlankXObj<br />
DSUnknownXObj<br />
DSInvalidXObj<br />
DSValidXObj<br />
DSDoubleCheckedXObj<br />
Blank appearance<br />
Signed but not validated appearance.<br />
Signed and failed validate appearance.<br />
Signed and valid, but identity not verified.<br />
Signed and valid and identity verified.<br />
Header File<br />
DigSigHFT.h<br />
Related Callbacks<br />
DSUnValidateSigProc<br />
Related Methods<br />
DigSigGetStdXObj<br />
240 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>
8<br />
<strong>Digital</strong> <strong>Signature</strong>’s Use of Core <strong>API</strong><br />
Objects<br />
The <strong>Digital</strong> <strong>Signature</strong>s Plug-in makes extensive use of the <strong>Acrobat</strong> Core <strong>API</strong> objects listed in<br />
this chapter. For information ,see Technical Note #5191, <strong>Acrobat</strong> Core <strong>API</strong> <strong>Reference</strong>.<br />
ASAtom<br />
A hashed token used in place of strings to optimize performance (it is much faster to<br />
compare ASAtoms than strings).<br />
ASCab<br />
A container object.<br />
ASFile<br />
An opaque representation of an open file.<br />
ASText<br />
A text object.<br />
AVPageView<br />
The area of the <strong>Acrobat</strong> viewer’s window that displays the contents of a document page.<br />
Every AVDoc has an AVPageView and vice versa. It contains references to the PDDoc and<br />
PDPage objects for the document being displayed.<br />
CosDoc<br />
A Cos level representation of an entire PDF file.<br />
CosObj<br />
A general object in a PDF file, which may be of any Cos object type.<br />
<strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong> 241
8<br />
<strong>Digital</strong> <strong>Signature</strong>’s Use of Core <strong>API</strong> Objects<br />
PDAnnot<br />
An annotation on a page in a PDF file. <strong>Acrobat</strong> viewers have two built-in annotation types:<br />
PDTextAnnot and PDLinkAnnot. Physical attributes of the annotation can be set and<br />
queried. Plug-ins add movie and Widget (form field) annotations. Developers can define<br />
new annotation subtypes by creating new annotation handlers.<br />
PDDoc<br />
The underlying PDF representation of a document. There is a correspondence between a<br />
PDDoc and an ASFile; the PDDoc object is the hidden object behind every AVDoc. An<br />
ASFile may have zero or more underlying files, so a PDF file does not always correspond<br />
to a single disk file. For example, an ASFile may provide access to PDF data in a database.<br />
Through PDDocs, your application can perform most of the Edit -> Pages menu items from<br />
<strong>Acrobat</strong> (delete, replace, and so on). Thumbnails can be created and deleted through this<br />
object. You can set and retrieve document information fields through this object as well.<br />
The first page in a PDDoc is page 0.<br />
242 <strong>Acrobat</strong> <strong>Digital</strong> <strong>Signature</strong> <strong>API</strong> <strong>Reference</strong>