/**
* OpenCPS PKI is the open source PKI Integration software
* Copyright (C) 2016-present OpenCPS community

* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.

* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package org.opencps.pki;

import java.security.GeneralSecurityException;
import java.util.Calendar;

/**
 * Signature information of document
 *
 * @author Nguyen Van Nguyen <nguyennv@iwayvietnam.com>
 */
abstract public class SignatureInfo {

	protected CertificateInfo certInfo;

    protected Calendar signDate;

    protected Calendar timeStamp;

    /**
     * Get certificate information
     */
    public CertificateInfo getCertificateInfo() {
        return certInfo;
    }

    /**
     * Get signature date
     */
    public Calendar getSignDate() {
        return signDate;
    }

    /**
     * Get signature time stamp
     */
    public Calendar getTimeStamp() {
        return timeStamp;
    }

    /**
     * Check signature is verified
     */
    abstract public Boolean isVerify() throws GeneralSecurityException;

}

@@ -811,16 +811,59 @@
 eption;%0A
+import java.security.cert.X509Certificate;%0A
 import j
@@ -1029,9 +1029,49 @@
  %7B%0A%0A
-%09
+    protected X509Certificate cert;%0A%0A    
 prot
@@ -1172,16 +1172,213 @@
 Stamp;%0A%0A
+    protected String digestAlgorithm;%0A%0A    protected String hashAlgorithm;%0A%0A    /**%0A     * Get signing certificate%0A     */%0A    public X509Certificate getCertificate() %7B%0A        return cert;%0A    %7D%0A%0A
     /**%0A
@@ -1724,24 +1724,274 @@
 Stamp;%0A    %7D
+%0A    %0A    /**%0A     * Get digest algorithm%0A     */%0A    public String getDigestAlgorithm() %7B%0A        return digestAlgorithm;%0A    %7D%0A    %0A    /**%0A     * Get hash algorithm%0A     */%0A    public String getHashAlgorithm() %7B%0A        return hashAlgorithm;%0A    %7D
 %0A%0A    /**%0A  

Update Signature information