try {
KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());
keystore.load(null, null);
PdfReader reader = new PdfReader(data);
AcroFields fields = reader.getAcroFields();
Collection<Signature> signatures = new ArrayList<Signature>();
if (fields != null) {
List<String> list = fields.getSignatureNames();
if ((list != null) && (!list.isEmpty())) {
for (String str : list) {
PdfPKCS7 pk = fields.verifySignature(str);
PdfString string = fields.getSignatureDictionary(str).getAsString(PdfName.CONTENTS);
byte[] content = string.getBytes();
X509Certificate certificate = pk.getSigningCertificate();
byte[] encoded = content;