summaryrefslogtreecommitdiff
path: root/texmf-dist/doc/latex/docassembly/examples/sign.tex
blob: 0581f1ebc528c68f341f840e23341b131ee6a9ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
% C:\Users\dpstory\AppData\Roaming\Adobe\Acrobat\Beta\Security\DonStory.pfx
\documentclass[12pt]{article}
\usepackage{eforms}
\usepackage{docassembly}
\usepackage{fancyvrb}

\hypersetup{pdfpagemode=UseNone}


\newcommand{\cs}[1]{\texttt{\char`\\#1}}

\pagestyle{empty}
\parskip\medskipamount
\parindent0pt

% Do not compile until you have a digital ID and password
% Actually, you can compile, but do not bring the PDF into Acrobat until you have a digital ID and password.
% You can view the PDF in other PDF viewers such as SumatraPDF.
\begin{docassembly}
\sigInfo{
    cSigFieldName: "sigOfDPS",
    cert: "D_P_Speaker.pfx", 
    password: "password",
    oInfo: {
      location: "AcroTeX Central, FL",
      reason: "I am approving this document for distribution",
      contactInfo: "dpspeaker@talking.edu",
      appearance: "My Signature"
%      appearance: "My Image"
    }
};
\signatureSign
\end{docassembly}

\begin{document}


%\maketitle

\hfill\smash{\raisebox{-\baselineskip}{March 23, 2009}}

\begin{tabular}{@{}ll}
To:         &Honorable Barrister Maxwell Frimpong\\
From:       &D. P. Speaker\\
Subject:    &On Business Proposal\\
\end{tabular}

\vspace{2\baselineskip}

Dear Mr.\ Frimpong;

Thank you for thinking of me concerning an ``important business proposal'' in
your recent and brief email to me on March 23, 2009. Recovering \$12,000,000
(twelve million US dollars) in claims sounds intriguing and exciting to me.
Such a large amount of money would certainly come in handy in these tough
times. Yet, regrettably, I must decline your kind offer; though I am in
retirement, I am, none-the-less, quite busy lately sorting my button
collection, and don't really have the time to pick up all this easy money.

Thank you again, Barrister Frimpong, for your offer. Please keep me
in mind should future opportunities arise.


\vspace{2\baselineskip}

Best regards,\\
\sigField{sigOfDPS}{2.5in}{4\baselineskip}\\[3pt]
Dr.\ D. P. Speaker\\
Department of Rhetoric,\\
Talking University\\
Talkville, FL 12345\\
\texttt{dpspeaker@talking.edu}


\newpage

\section{Creating and Signing a Signature Field}

The \textsf{eforms} package can create a signature field with the \cs{sigField} command, and
using the \textsf{aeb\_pro} package with its \texttt{docassembly} environment, can also sign the field
from a {\LaTeX} source.

The {\LaTeX} code for creating the signature field of this document is
\begin{Verbatim}[xleftmargin=20pt,fontsize=\small]
Best regards,\\
\sigField{sigOfDPS}{2.5in}{4\baselineskip}\\[3pt]
Dr.\ D. P. Speaker\\
Department of Rhetoric,\\
Talking University\\
Talkville, FL 12345\\
\texttt{dpspeaker@talking.edu}
\end{Verbatim}
The \cs{sigField} command appears in the second line, and uses the usual
syntax for form fields, as defined in the \textsf{eforms} package.
Here's what the field looks like when it is unsigned.

\sigField{sigOfDPS1}{2.5in}{4\baselineskip}

Once the field is created, it can be signed using the Acrobat or Adobe
Reader (version 10.0.1 or later) user interface.

A signature field may also be signed programmatically from the {\LaTeX}
source file using AeB Pro. The first signature field of this document
was automatically signed when the newly created PDF is brought into
Acrobat.
\begin{Verbatim}[xleftmargin=20pt,fontsize=\footnotesize]
\begin{docassembly}
\sigInfo{
    cSigFieldName: "sigOfDPS",
    cert: "<name>.pfx", password: "<password>",
    oInfo: {
      location: "AcroTeX Central, FL",
      reason: "I am approving this document for distribution",
      contactInfo: "dpspeaker@talking.edu",
      appearance: "My Signature" }
};
\signatureSign
\end{docassembly}
\end{Verbatim}
The script above was used to programmatically sign the signature field
with field name of \texttt{sigOfDPS}. The value of the \texttt{password}
key to protect my secrets. The first command, \cs{sigInfo}, creates an
JavaScript object, \texttt{oSigInfo}. The command \cs{signatureSign} uses
the information in this object to sign the field designated by the
\texttt{cSigFieldName} property.

The general syntax of the argument of \cs{sigInfo} is displayed below.
\def\meta#1{$\langle\textsl{\texttt{#1}}\rangle$}
\begin{Verbatim}[xleftmargin=20pt,fontsize=\footnotesize,commandchars={!()}]
\sigInfo{
    cSigFieldName: "!meta(sigFldName)",
    oHandler: !meta(securityHandlerObj),
    path2Cert: !meta(path),
    cert: "!meta(certName).pfx",
    password: "!meta(password)",
    bUI: true|false;
    oInfo: {
        !meta(various properties)
    }
}
\end{Verbatim}
The first five keys are used by AeB Pro to build the proper information
needed sign the field.
\begin{description}
  \item[\normalfont\texttt{cSigFieldName} (required)] The
      name of the signature field to be signed.
  \item[\normalfont\texttt{oHandler} (optional)] The security
      handler to be used. If this key is  not present,
      \texttt{security.PPKLiteHandler} is used.
  \item[\normalfont\texttt{path2Cert} (optional)] The
      device-independent path to the PFX file to be used. If not
      present, AeB Pro uses the name provided by the \texttt{cert} key
      and builds the path to where Acrobat normally saves digital IDs.
  \item[\normalfont\texttt{cert} (optional)] The name of the digital
      ID to be used for signing. Optional if \texttt{path2Cert} is
      provided, required otherwise.
  \item[\normalfont\texttt{password} (required)] The password for the PFX file
      provided, necessary to login to the security handler (\texttt{oHandler}).
  \item [\normalfont\texttt{bUI} (optional)] A Boolean, if
      \texttt{true} the security handler displays the user interface
      when signing. The default is \texttt{false}.
  \item[\normalfont\texttt{oInfo} (optional)] The \texttt{oInfo} property key is
      one that appears in the argument property list of the
      \texttt{\textsl{Field}.signatureSign()} method. It is passed to
      the argument of this JavaScript method. See the documentation of
      \texttt{\textsl{Field}.signatureSign()} in the
      \emph{JavaScript for Acrobat API Reference} for more information.
\end{description}

Additional information on signatures is found at the
\textbf{Acrobat Developer Center}.\footnote{\url{http://www.adobe.com/go/acrobat_developer}}
Refer to the \emph{JavaScript for Acrobat API Reference}, also found at the \textbf{Acrobat Developer Center},
for details on these methods and their parameters. Adobe is
notorious for moving its reference documents and renaming them, year after
year. Good luck searching the Adobe web site for the references you need.

\section{Compiling this file}

In the preamble of this document, the \texttt{docassembly} environment is found:
\begin{Verbatim}[xleftmargin=20pt,fontsize=\small]
\begin{docassembly}
\sigInfo{
    cert: "<name>.pfx", password: "<password>",
    oInfo: {
      location: "AcroTeX Central, FL",
      reason: "I am certifying this document",
      mdp: "defaultAndComments",
      contactInfo: "dpspeaker@talking.edu"
    }
};
\certifyInvisibleSign
\end{docassembly}
\end{Verbatim}
To compile this document yourself, you need to create a digital ID using
\textsf{Acrobat}. Replace \texttt{<name>} with the file name of your digital
ID. and of course replace \texttt{<password>} with the password you selected
when you created your digital ID. Modify the \texttt{oInfo} property as
designed.


Now, back to my retirement.

\end{document}

Digital Signatures Workflow Guide
http://www.adobe.com/devnet-docs/acrobatetk/tools/DigSig/index.html