11.07.2015 Views

TechNote 0006: Digital Signatures in PDF/A-1

TechNote 0006: Digital Signatures in PDF/A-1

TechNote 0006: Digital Signatures in PDF/A-1

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>PDF</strong>/ACompetence Centersigned for document signatures. Object digests have been officially deprecatedby Adobe, and are not <strong>in</strong>cluded <strong>in</strong> the current draft for ISO 32000.1.5 Incremental UpdateModifications to a document, after it has been signed, should be saved as <strong>in</strong>crementalupdates. This method preserves the consistency of the signed data withthe digest and allows for recreat<strong>in</strong>g the state of the document as it existed atthe time of sign<strong>in</strong>g. Be aware, however, that use of this method may cause aviewer to mark the signature as <strong>in</strong>valid, depend<strong>in</strong>g on the changes made.1.6 Multiple <strong>Signatures</strong>A document not only can conta<strong>in</strong> more than one signature field but can also besigned aga<strong>in</strong> (after it has been saved) us<strong>in</strong>g the <strong>in</strong>cremental update feature.2008-03-14 <strong>Digital</strong> <strong>Signatures</strong> <strong>in</strong> <strong>PDF</strong> page 3


<strong>PDF</strong>/ACompetence Center2 <strong>PDF</strong>/A RequirementsThe follow<strong>in</strong>g sections describe the m<strong>in</strong>imum requirements to embed a <strong>PDF</strong>/A-1conform<strong>in</strong>g digital signature.2.1 Signature TypesOnly document signatures can be used <strong>in</strong> <strong>PDF</strong>/A-1 conform<strong>in</strong>g documents. MDPand usage rights signatures conta<strong>in</strong> either dictionary entries which are not def<strong>in</strong>ed<strong>in</strong> <strong>PDF</strong> Reference 1.4 or are referenced from undef<strong>in</strong>ed dictionary entries.A <strong>PDF</strong>/A-1 conformant viewer will treat them as private data and will not act onthem.2.2 Dictionaries and required EntriesS<strong>in</strong>ce digital signatures <strong>in</strong> <strong>PDF</strong> are comprised of form fields and widget annotations,their describ<strong>in</strong>g dictionaries must conform to the follow<strong>in</strong>g sections ofISO 19005-1:• The annotation dictionary (which is the same as the signature field dictionary)must conform to section 6.5 and 6.6 and requires the entries Subtype,Rect and AP.• The signature field dictionary must conform to sections 6.6.2, 6.9 and requiresthe entries FT and V.• The appearance dictionary must conform to section 6.5.3 and requires the Nentry.• The signature dictionary requires the Filter, Contents and ByteRange entries.• The <strong>in</strong>teractive form dictionary must conform to section 6.9 and requires theFields entry.• The document catalog dictionary must conform to sections 6.6.2, 6.8.4,6.7.2, 6.1.11, 6.1.13, 6.2.2, 6.8.3.3 and requires the AcroForm entry.2.3 Signed Document PartsThe ByteRange entry conta<strong>in</strong>s an array of pairs of <strong>in</strong>tegers describ<strong>in</strong>g the partsof the document for which the digest is calculated. The ByteRange array mustexclude the str<strong>in</strong>g value (<strong>in</strong>clud<strong>in</strong>g the str<strong>in</strong>g delimiters) of the Contents entry.2008-03-14 <strong>PDF</strong>/A Requirements page 4


<strong>PDF</strong>/ACompetence Center2.4 Visual AppearanceThe annotation dictionary requires an appearance dictionary (AP), whose normalappearance (N) is a Form XObject, that describes the visual appearance ofthe signature. The visual appearance must also exist for an <strong>in</strong>visible signaturebut may be empty. The content stream of the Form XObject must conform tosection 6.2.10 of ISO 19005-1. In addition, all requirements from 6.2.3 through6.2.9 as well as 6.3 and 6.4 shall apply.2.5 Optional Dictionary EntriesSignature handlers are free to use or omit those entries that are marked optional<strong>in</strong> <strong>PDF</strong> Reference 1.4 to 1.7, but are encouraged to use them <strong>in</strong> the describedway if they are used at all.2.6 Private Dictionary EntriesSpecific signature handlers may add private entries of their own. To avoid nameduplication, it is suggested that the keys for all such private entries be prefixedwith the registered handler name followed by a period (.).2008-03-14 <strong>PDF</strong>/A Requirements page 5


<strong>PDF</strong>/ACompetence Center3 Recommendations for <strong>Signatures</strong> <strong>in</strong><strong>PDF</strong>/A-1The follow<strong>in</strong>g recommendations apply to public key signature handlers only andare addressed to writers of vendor specific signature handlers. Although theserecommendations are not part of the <strong>PDF</strong>/A-1 standard, implementers are encouragedto follow them <strong>in</strong> order to avoid security issues, obta<strong>in</strong> upward compatibilitywith <strong>PDF</strong> Reference 1.5–1.7 and maximize <strong>in</strong>teroperability between securityhandlers from different vendors.3.1 Signature InteroperabilityThe SubFilter entry <strong>in</strong> the signature dictionary specifies the encod<strong>in</strong>g of thesignature value and key <strong>in</strong>formation, and the Filter entry specifies the preferredhandler to use to validate the signature. For maximum <strong>in</strong>teroperability betweensignature handlers from different vendors, only the SubFilter valuesadbe.pkcs7.detached and adbe.pkcs7.sha1, as def<strong>in</strong>ed <strong>in</strong> <strong>PDF</strong> Reference1.5, should be used.3.2 Contents Str<strong>in</strong>gThe Contents entry should conta<strong>in</strong> the signature as a hex str<strong>in</strong>g, start<strong>in</strong>g with< and end<strong>in</strong>g with >.3.3 Visual AppearanceIt is highly recommended to structure the appearance streams accord<strong>in</strong>g toAdobe’s technical note <strong>Digital</strong> Signature Appearances, version for Acrobat 6(see Bibliography). For security reasons only the layers n0 and n2 as well asthe DSz entry <strong>in</strong> XObject dictionary of the AcroForm’s resources (DR) shouldbe used. Specifically the n1, n3 and n4 layers as well as the DSx and DSy entries,as described <strong>in</strong> Adobe’s earlier technical note <strong>Digital</strong> Signature Appearances,version for Acrobat 5, must not be used.3.4 Cryptographic Message SyntaxOnly a DER-encoded PKCS#7 b<strong>in</strong>ary data object, conform<strong>in</strong>g to RFC 3852,should be used as the value of the signature dictionary’s Contents entry thusmak<strong>in</strong>g the PKCS#1 b<strong>in</strong>ary data object and the X.509 certificate cha<strong>in</strong> stored <strong>in</strong>the Cert entry obsolete.2008-03-14 Recommendations for <strong>Signatures</strong> <strong>in</strong> <strong>PDF</strong>/A-1 page 6


<strong>PDF</strong>/ACompetence Center3.5 Digest AlgorithmDue to known security weaknesses the MD5 algorithm should not be used tocalculate the digest of the signed part of the document. SHA-1 should be used<strong>in</strong>stead.3.6 Time stampThe time of sign<strong>in</strong>g, if it is generated <strong>in</strong> a verifiable way from a secure timeserver, should be <strong>in</strong>cluded <strong>in</strong> the signature value, i.e. embedded <strong>in</strong> the PKCS#7b<strong>in</strong>ary data object. The time stamp token must conform to RFC 3161 and mustbe computed and embedded <strong>in</strong>to the PKCS#7 object as described <strong>in</strong> Appendix Aof RFC 3161. A normal unverified computer time should preferably be embedded<strong>in</strong>to the PKCS#7 object or can alternatively be stored <strong>in</strong> the M entry of thesignature dictionary.3.7 Revocation InformationIf needed, only Onl<strong>in</strong>e Certificate Status Protocol (OCSP) responses, described<strong>in</strong> RFC 2560, X.509 Internet Public Key Infrastructure Onl<strong>in</strong>e Certificate StatusProtocol (OCSP) should be <strong>in</strong>cluded <strong>in</strong> the PKCS#7 object. Creators should refra<strong>in</strong>from embedd<strong>in</strong>g certificate revocation lists (CRLs) <strong>in</strong>to the PKCS#7 object<strong>in</strong> order to keep file sizes small.3.8 Trust Cha<strong>in</strong>The PKCS#7 object should conta<strong>in</strong> the signer’s certificate and all issuer certificatesfrom the signer’s trust cha<strong>in</strong>. The signer’s certificate should be the firstcertificate <strong>in</strong> the PKCS#7 object.3.9 Document XMP Metadata<strong>PDF</strong>/A conformant signature tools should record the sign<strong>in</strong>g process as an action<strong>in</strong> the xmpMM:History entry <strong>in</strong> the document's XMP metadata. The softwareAgentfield should be specified, and the action field should be specified assigned.2008-03-14 Recommendations for <strong>Signatures</strong> <strong>in</strong> <strong>PDF</strong>/A-1 page 7


<strong>PDF</strong>/ACompetence Center4 SummaryThe table below summarizes the required or recommended values of the relevantdictionary entries if one or more digital signatures are embedded.DictionaryEntry<strong>PDF</strong>/A-1conformanceCatalog AcroForm requiredAcroForm Fields requiredRecommendationAcroForm SigFlags optional 3 (<strong>in</strong>teger)AcroForm/DR/XObject DSx private Don’t useAcroForm/DR/XObject DSy private Don’t useAcroForm/DR/XObject DSz private Can be usedAnnotation Subtype requiredAnnotation Rect requiredAnnotation AP requiredAnnotation AS optional Don’t useField FT requiredField Parent required if a fieldhierarchy is usedField Kids required if a fieldhierarchy is usedField V requiredDon’t useDon’t useField DV optional Don’t useSignature Filter required Name of the signature handlerto use to validate the signatureSignature SubFilter optional adbe.pkcs7.sha1adbe.pkcs7.detachedSignature Contents required DER-encoded PKCS#7 hexstr<strong>in</strong>g; don’t use MD5Signature Cert private Don’t useSignature ByteRange requiredSignature Reference private Don’t useSignature Name optional Use the subject name of thePKCS#7 objectSignature M optional Unverified time stamp if notembedded <strong>in</strong> the PKCS#7 objectAppearance N required2008-03-14 Summary page 8


<strong>PDF</strong>/ACompetence CenterBibliography[1] ISO 19005-1: Document management — Electronic document file formatfor long-term preservation — Part 1: Use of <strong>PDF</strong> 1.4 (<strong>PDF</strong>/A-1)www.iso.ch[2] Adobe Systems Incorporated: <strong>PDF</strong> Reference third edition, Adobe PortableDocument Format Version 1.4www.adobe.com/devnet/pdf/pdfs/<strong>PDF</strong>Reference.pdf[3] Adobe Systems Incorporated: <strong>PDF</strong> Reference fourth edition, Adobe PortableDocument Format Version 1.5www.adobe.com/devnet/pdf/pdfs/<strong>PDF</strong>Reference15_v6.pdf[4] Adobe Systems Incorporated: <strong>PDF</strong> Reference fifth edition, Adobe PortableDocument Format Version 1.6www.adobe.com/devnet/pdf/pdfs/<strong>PDF</strong>Reference16.pdf[5] Adobe Systems Incorporated: <strong>PDF</strong> Reference sixth edition, Adobe PortableDocument Format Version 1.7www.adobe.com/devnet/acrobat/pdfs/pdf_reference.pdf[6] Adobe Systems Incorporated (October 2006): <strong>Digital</strong> Signature Appearanceswww.adobe.com/devnet/acrobat/pdfs/PPKAppearances.pdf[7] Adobe Systems Incorporated (March 2006): <strong>Digital</strong> <strong>Signatures</strong> <strong>in</strong> the <strong>PDF</strong>Languagewww.adobe.com/devnet/acrobat/pdfs/<strong>Digital</strong><strong>Signatures</strong>In<strong>PDF</strong>.pdf[8] ITU-T X.690 (07/2002): SERIES X: DATA NETWORKS AND OPEN SYSTEMCOMMUNICATIONS, OSI network<strong>in</strong>g and system aspects – Abstract SyntaxNotation One (ASN.1)www.itu.<strong>in</strong>t/ITU-T/studygroups/com17/languages/X.690-0207.pdf[9] ISO/IEC 8825-1 (2002): Information technology - ASN.1 encod<strong>in</strong>g rules:specification of Basic Encod<strong>in</strong>g Rules (BER), Canonical Encod<strong>in</strong>g Rules(CER) and Dist<strong>in</strong>guished Encod<strong>in</strong>g Rules (DER)www.iso.ch[10]IETF RFC 2315: PKCS #7: Cryptographic Message Syntax, Version 1.5www.ietf.org/rfc/rfc2315.txt[11]IETF RFC 2630: Cryptographic Message Syntaxwww.ietf.org/rfc/rfc2630.txt[12]IETF RFC 3852: Cryptographic Message Syntax (CMS)www.ietf.org/rfc/rfc3852.txt2008-03-14 Summary page 9


<strong>PDF</strong>/ACompetence Center[13]IETF RFC 3039: Internet X.509 Public Key Infrastructure, Qualified CertificatesProfilewww.ietf.org/rfc/rfc3039.txt[14]IETF RFC 3280: Internet X.509 Public Key Infrastructure: Certificate andCertificate Revocation List (CRL) Profilewww.ietf.org/rfc/rfc3280.txt[15]IETF RFC 2560: Internet X.509 Public Key Infrastructure: Onl<strong>in</strong>e CertificateStatus Protocol - OCSPwww.ietf.org/rfc/rfc2560.txt[16]IETF RFC 3161: Internet X.509 Public Key Infrastructure Time-Stamp Protocol(TSP)www.ietf.org/rfc/rfc3161.txt[17]IETF RFC 1321: The MD5 Message-Digest Algorithmwww.ietf.org/rfc/rfc1321.txt[18]IETF RFC 3174: US Secure Hash Algorithm 1 (SHA1)www.ietf.org/rfc/rfc3174.txtCopyright and UsageCopyright © 2007-2008 <strong>PDF</strong>/A Competence Center, www.pdfa.org.You can l<strong>in</strong>k to the orig<strong>in</strong>al location of this document. However, redistribut<strong>in</strong>gthis document is only allowed with written approval.Please contact <strong>in</strong>fo@pdfa.org if you have any questions regard<strong>in</strong>g the contentsof this <strong>TechNote</strong> or the redistribution policy.Status of this Document2007-09-20 First released version2008-03-14 Update:• Updated formatt<strong>in</strong>g and added references to the entries <strong>in</strong> the bibliography2008-03-14 Summary page 10

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!