Security
Digital IDs and Certification Methods
12
Checking Information on Certificates
As you learned earlier, you may obtain a certificates through the
certificates
property
of a
signatureInfo
object, which is returned by a call to the signature field’s
signatureInfo
method. The certificate properties are described above in
Table 12.3,
and the relative distinguished name properties are defined in
Table 12.5.
In the following example, the signer’s common name, the certificate’s serial number, and
the distinguished name information are displayed:
// Obtain the signature field:
var f = this.getField("mySignatureField");
// Validate the signature field:
var status = f.signatureValidate();
// Obtain the signature information
var sigInfo = f.signatureInfo();
// Obtain the certificate:
var cert = sigInfo.certificates[0];
console.println("signer’s common name: " + cert.subjectCN);
console.println("serial number: " + cert.serialNumber);
// Distinguished name information:
console.println("distinguished common name: " + cert.subjectDN.cn);
console.println("distinguished organization: " + cert.subjectDN.o);
Acrobat JavaScript Scripting Guide
225