pdf/src/main/java/se/idsec/signservice/integration/document/pdf/PdfSignedDocumentProcessor.java
@Override
    public byte[] sign(final InputStream content) throws IOException {
      try {
        this.updatedCmsSignedData = PDFBoxSignatureUtils.updatePdfPKCS7(
          this.originalSignedData, this.newSignedAttributesData, this.newSignatureValue, this.signerCertchain);
        this.cmsSignedAttributes = PDFBoxSignatureUtils.getCmsSignedAttributes(this.updatedCmsSignedData);
        return this.updatedCmsSignedData;
      }
      catch (CMSException e) {
        throw new IOException(e.getMessage(), e);
      }
    }
/**
     * SignatureInterface implementation.
     * <p>
     * This method will be called from inside of the pdfbox and create the PKCS #7 signature (CMS ContentInfo). The given
     * InputStream contains the bytes that are given by the byte range.
     * </p>
     * <p>
     * In this implementation of the signature interface no new signature is created. Instead a previous pre-sign
     * signature is updated with signature value, signed attributes and certificates from a remote signature process
     * </p>
     *
     * @param content
     *          the message bytes being signed (specified by ByteRange in the signature dictionary)
     * @return CMS ContentInfo bytes holding the complete PKCS#7 signature structure
     * @throws IOException
     *           error during signature creation
     */


@param content
the message bytes being signed (specified by ByteRange in the signature dictionary)
@return CMS ContentInfo bytes holding the complete PKCS#7 signature structure
@throws IOException
error during signature creation
@param content the message bytes being signed ( specified by ByteRange in the signature dictionary ) @return CMS ContentInfo bytes holding the complete PKCS#7 signature structure @throws IOException error during signature creation
@Override
    public byte[] sign(final InputStream content) throws IOException {
      try {
        this.updatedCmsSignedData = PDFBoxSignatureUtils.updatePdfPKCS7(
          this.originalSignedData, this.newSignedAttributesData, this.newSignatureValue, this.signerCertchain);
        this.cmsSignedAttributes = PDFBoxSignatureUtils.getCmsSignedAttributes(this.updatedCmsSignedData);
        return this.updatedCmsSignedData;
      }
      catch (CMSException e) {
        throw new IOException(e.getMessage(), e);
      }
    }
@ Override public byte [ ] sign ( final InputStream content ) throws IOException { try { this . updatedCmsSignedData = PDFBoxSignatureUtils . updatePdfPKCS7 ( this . originalSignedData , this . newSignedAttributesData , this . newSignatureValue , this . signerCertchain ) ; this . cmsSignedAttributes = PDFBoxSignatureUtils . getCmsSignedAttributes ( this . updatedCmsSignedData ) ; return this . updatedCmsSignedData ; } catch ( CMSException e ) { throw new IOException ( e . getMessage ( ) , e ) ; } }
SignatureInterface implementation.
SignatureInterface implementation .