/**
 * 
 */
package org.opencps.pki;

import java.security.SignatureException;
import java.security.cert.X509Certificate;

/**
 * @author nguyennv
 *
 */
public class PdfPkcs7Signer extends PdfSigner {

    /**
     * Constructor
     */
    public PdfPkcs7Signer(String filePath, X509Certificate cert) {
        super(filePath, cert);
    }
    
    /**
     * Constructor
     */
    public PdfPkcs7Signer(String filePath, X509Certificate cert, String tempFilePath, String signedFilePath, boolean isVisible) {
        super(filePath, cert, tempFilePath, signedFilePath, isVisible);
    }

    /**
     * (non-Javadoc)
     * @throws SignatureException 
     * @see org.opencps.pki.Signer#computeHash()
     */
    @Override
    public byte[] computeHash() throws SignatureException {
        float llx = 36.0f;
        float lly = 48.0f;
        SignatureImage signatureImage = getSignatureGraphic();
        if (signatureImage != null) {
            int signatureImageWidth = signatureImage.getBufferedImage().getWidth();
            int signatureImageHeight = signatureImage.getBufferedImage().getHeight();
            float urx = llx + signatureImageWidth;
            float ury = lly + signatureImageHeight;
            return computeDigest(llx, lly, urx, ury);
        }
        else {
            return computeDigest(llx, lly, 144, 80);
        }
    }

    /**
     * Compute hash key with corner coordinates of rectangle
     */
    @Override
    public byte[] computeHash(float llx, float lly, float urx, float ury) throws SignatureException {
        return computeDigest(llx, lly, urx, ury);
    }

    /**
     * (non-Javadoc)
     * @throws SignatureException 
     * @see org.opencps.pki.Signer#sign()
     */
    @Override
    public Boolean sign(byte[] signature) throws SignatureException {
        return sign(signature, getTempFilePath());
    }

    /**
     * (non-Javadoc)
     * @throws SignatureException 
     * @see org.opencps.pki.Signer#sign()
     */
    @Override
    public Boolean sign(byte[] signature, String filePath) throws SignatureException {
        return signExternal(new Pksc7SignatureContainer(this, signature), filePath);
    }
}

@@ -603,1261 +603,233 @@
   * 
-(non-Javadoc)%0A     * @throws SignatureException %0A     * @see org.opencps.pki.Signer#computeHash()%0A     */%0A    @Override%0A    public byte%5B%5D computeHash() throws SignatureException %7B%0A        float llx = 36.0f;%0A        float lly = 48.0f;%0A        SignatureImage signatureImage = getSignatureGraphic();%0A        if (signatureImage != null) %7B%0A            int signatureImageWidth = signatureImage.getBufferedImage().getWidth();%0A            int signatureImageHeight = signatureImage.getBufferedImage().getHeight();%0A            float urx = llx + signatureImageWidth;%0A            float ury = lly + signatureImageHeight;%0A            return computeDigest(llx, lly, urx, ury);%0A        %7D%0A        else %7B%0A            return computeDigest(llx, lly, 144, 80);%0A        %7D%0A    %7D%0A%0A    /**%0A     * Compute hash key with corner coordinates of rectangle%0A     */%0A    @Override%0A    public byte%5B%5D computeHash(float llx, float lly, float urx, float ury) throws SignatureException %7B%0A        return computeDigest(llx, lly, urx, ury);%0A    %7D%0A%0A    /**%0A     * (non-Javadoc)%0A     * @throws SignatureException %0A     * @see org.opencps.pki.Signer#sign()%0A     */%0A    @Override%0A    public Boolean sign(byte%5B%5D signature) throws SignatureException %7B%0A        return sign(signature, getTempFilePath()
+Compute hash key with corner coordinates of rectangle%0A     */%0A    @Override%0A    public byte%5B%5D computeHash(float llx, float lly, float urx, float ury) throws SignatureException %7B%0A        return computeDigest(llx, lly, urx, ury
 );%0A 

Remove duplicate method