PDDocument docOpen1 = PDDocument.load(output);
KeyStore ks1 = KeyStore.getInstance("PKCS12");
ks1.load(new FileInputStream(privateCert1), password1.toCharArray());
PublicKeyDecryptionMaterial pdm = new PublicKeyDecryptionMaterial(ks1, null, password1);
docOpen1.openProtection(pdm);
docOpen1.close();
/* open second time */
PDDocument docOpen2 = PDDocument.load(output);