* @throws GeneralSecurityException
* @throws IOException
* @throws DocumentException
*/
public static void signExternalContainer(PdfSignatureAppearance sap, ExternalSignatureContainer externalSignatureContainer, int estimatedSize) throws GeneralSecurityException, IOException, DocumentException {
PdfSignature dic = new PdfSignature(null, null);
dic.setReason(sap.getReason());
dic.setLocation(sap.getLocation());
dic.setSignatureCreator(sap.getSignatureCreator());
dic.setContact(sap.getContact());
dic.setDate(new PdfDate(sap.getSignDate())); // time-stamp will over-rule this
externalSignatureContainer.modifySigningDictionary(dic);
sap.setCryptoDictionary(dic);
HashMap<PdfName, Integer> exc = new HashMap<PdfName, Integer>();
exc.put(PdfName.CONTENTS, new Integer(estimatedSize * 2 + 2));