/**
 * 
 */
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);
    }

    /**
     * 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, String filePath) throws SignatureException {
        return signExternal(new Pksc7SignatureContainer(this, signature), filePath);
    }
}

@@ -1,13 +1,746 @@
 /**%0A
- * %0A 
+* OpenCPS PKI is the open source PKI Integration software%0A* Copyright (C) 2016-present OpenCPS community%0A%0A* This program is free software: you can redistribute it and/or modify%0A* it under the terms of the GNU Affero General Public License as published by%0A* the Free Software Foundation, either version 3 of the License, or%0A* any later version.%0A%0A* This program is distributed in the hope that it will be useful,%0A* but WITHOUT ANY WARRANTY; without even the implied warranty of%0A* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the%0A* GNU Affero General Public License for more details.%0A* You should have received a copy of the GNU Affero General Public License%0A* along with this program. If not, see %3Chttp://www.gnu.org/licenses/%3E%0A
 */%0Ap
@@ -860,27 +860,110 @@
 %0A * 
-@author nguyennv%0A *
+Signer for pdf document using encoded pkcs7%0A *%0A * @author Nguyen Van Nguyen %3Cnguyennv@iwayvietnam.com%3E
 %0A */

Add license header and class description