
Acrobat 9 Family of Products
Controlling Signing with Seed Values
Security Feature User Guide
Specifying Certificates by Key Usage 83
1. Create a signature field with an intuitive name and tooltip.
2. Get the required certificates and install them in some accessible location.
Tip:
They must be in a .
cer
files in a DER format.
3. Create the JavaScript that gets the field object and uses the seed value method. Use
security.importFromFile
to get the DER- encoded certificates from their installed location
(
Example 5.9
).
4. Add the
subject
and
issuer
properties to the
certspec
object.
5. Enter a flag value to indicate whether the value is required or not. Either or both the
subject
and
issuer
may be required.
6. Run the JavaScript, save the document, and test the field.
Example 5.9
Certificate issuer and subject seed value
// Obtain the signature field object:
var f = this.getField("mySigFieldName");
var mySubjectCert = security.importFromFile("Certificate",
"/C/Temp/nebwhifflesnit_DER.cer");
var myIssuerCert = security.importFromFile("Certificate",
"/C/Temp/nebsCompany_DER.cer");
f.signatureSetSeedValue(
{
certspec: {
subject: [mySubjectCert],
issuer: [myIssuerCert],
flags: 3
}
} )
5.10.2 Specifying Certificates by Key Usage
Acrobat’s default signature handler allows signing with certificates where the
Key usage
field is
Sign
transaction
or
Sign document
. However, the
keyUsage
seed value allows you to override the default
behavior and limit signing to those certificates where the keyUsage is set to any value defined in RFC 3280
(see
Table 11
). While the seed value could be used to require or disallow any of RFC 3280
keyUsage
values, the two most common cases allow or disallow
digitalSignature
(bits 2,1) (displayed as
Sign
transaction
in Acrobat’s Certificate Viewer) or
nonRepudiation
(4,3) (displayed as
Sign document
in
Acrobat’s Certificate Viewer). However, any combination of uses may be set.
To restrict signing to a certificate with a particular
keyUsage
:
1. Create a signature field with an intuitive name and tooltip.
2. Create the JavaScript that gets the field object and uses the seed value method (
Example 5.10
).
3. Specify the keyUsage value in HEX: