ArrayList<String> signatures = fields.getSignatureNames();
Map<String, PdfPKCS7> result = new LinkedHashMap<String, PdfPKCS7>();
// Check if the input document is signed.
if (signatures.size() == 0) {
throw new NoSignatureException(messages.getString(
"Document_has_no_signature."));
}
// Validate each signature.
for (String signature : signatures) {