/*
 * Copyright
 *   2008 axYus - www.axyus.com
 *   2008 L.Meckert - laurent.meckert.com
 *
 * This file is part of XEMELIOS.
 *
 * XEMELIOS is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * XEMELIOS 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with XEMELIOS; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.gouv.finances.cp.xemelios.plugin.signerfichier;

import java.io.File;
import java.util.Date;
import java.util.Enumeration;
import javax.xml.namespace.NamespaceContext;

/**
 *
 * @author laurent.meckert
 */
public interface IFileSigner extends IKeystoreValider {

    public void setNsCtx(NamespaceContext ctx);

    /**
     * 
     * @return
     */
    public File getInputFile();

    /**
     * 
     * @param inf 
     */
    public void setInputFile(File inf);

    /**
     * 
     * @return
     */
    public File getOutputFile();

    /**
     * 
     * @param outf 
     */
    public void setOutputFile(File outf);

    /**
     * 
     * @return
     */
    public File getKeystoreFile();

    /**
     * 
     * @param kf 
     */
    public void setKeystoreFile(File kf);

    /**
     * 
     * @return
     */
    public String getKeystoreType();

    /**
     * 
     * @throws Exception
     */
    public void loadInputFile() throws Exception;

    /**
     * 
     * @return
     * @throws Exception
     */
    public Enumeration<String> getAliases() throws Exception;

    /**
     * 
     * 
     * @return 
     */
    public String getAlias();

    public String getIssuedFor(String rawalias);

    public String getDetails(String rawalias);

    public String getNomBonhomme(String rawAlias);
    public String getEmetteur(String rawAlias);
    public Date getDebutValidite(String rawAlias);
    public Date getFinValidite(String rawAlias);
    /**
     * 
     * @param xpath
     */
    public void addSubtractFilter(String xpath);

    /**
     * 
     * @param xpath
     */
    public void addIntersectFilter(String xpath);

    /**
     * 
     * @throws Exception 
     */
    public void sign() throws Exception;

    /**
     * 
     * @return
     */
    public String getStatusAsString();

    /**
     * 
     * @return
     */
    public int getStatusAsSeverity();

    /**
     *
     * @return true si le fichier XML a ete correctement parsé
     */
    public boolean parseOK();

    /**
     *
     * @return true si l'algorithme de signature est supporte
     */
    public boolean algoIdOK();

    /**
     *
     * @return true si signature ok
     */
    public boolean signOK();

    /**
     *
     * @return true si fichier de sortie nbien ecrit
     */
    public boolean writeOK();

    /**
     * 
     * @nettoyage
     */
    public void dispose();
}
