List of usage examples for org.bouncycastle.cms SignerInformation getEncodedSignedAttributes
public byte[] getEncodedSignedAttributes() throws IOException
From source file:com.aaasec.sigserv.csspsupport.pdfbox.PdfBoxSigUtil.java
License:EUPL
/** * This method extracts data from a dummy signature into the PdfBoxModel used * in a later stage to update the signature with an externally created signature. * @param model A PdfBoxModel for this signature task. * @throws IOException /* w w w. j a va2s .c om*/ */ public static void parseSignedData(PdfSignModel model) throws IOException { CMSSignedData signedData = model.getSignedData(); SignerInformationStore signerInfos = signedData.getSignerInfos(); Iterator iterator = signerInfos.getSigners().iterator(); List<SignerInformation> siList = new ArrayList<SignerInformation>(); while (iterator.hasNext()) { siList.add((SignerInformation) iterator.next()); } if (!siList.isEmpty()) { SignerInformation si = siList.get(0); model.setCmsSigAttrBytes(si.getEncodedSignedAttributes()); } }