/**
*
*/
package at.gv.egiz.pdfas.api.sign;
import java.util.Properties;
import at.gv.egiz.pdfas.api.commons.Constants;
import at.gv.egiz.pdfas.api.io.DataSink;
import at.gv.egiz.pdfas.api.io.DataSource;
import at.gv.egiz.pdfas.api.sign.pos.SignaturePositioning;
import at.gv.egiz.pdfas.api.timestamp.TimeStamper;
import at.knowcenter.wag.egov.egiz.sig.SignatureTypes;
/**
* Parameter object that holds the sign parameters.
*
* @author wprinz
*/
public class SignParameters
{
// 23.11.2010 changed by exthex - added parameters for placeholder handling
/**
* Strict matching mode for placeholder extraction.
* If the placeholder with the given id is not found in the document, an exception will be thrown.
*/
public static final int PLACEHOLDER_MATCH_MODE_STRICT = 0;
/**
* A moderate matching mode for placeholder extraction.
* If the placeholder with the given id is not found in the document, the first placeholder without an id will be taken.
* If there is no such placeholder, the signature will be placed as usual, according to the pos parameter of the signature profile used.
*/
public static final int PLACEHOLDER_MATCH_MODE_MODERATE = 1;
/**
* A more lenient matching mode for placeholder extraction.
* If the placeholder with the given id is not found in the document, the first found placeholder will be taken, regardless if it has an id set, or not.
* If there is no placeholder at all, the signature will be placed as usual, according to the pos parameter of the signature profile used.
*/
public static final int PLACEHOLDER_MATCH_MODE_LENIENT = 2;
/**
* The document to be signed.
*
*
* The DataSource implementation encapsulates the actual representaion of the * data. E.g. the DataSource may be File based or byte array based. See * package at.gv.egiz.pdfas.framework.input and at.gv.pdfas.impl.input *
*/ protected DataSource document = null; /** * The type of the signature. * ** May be {@link Constants#SIGNATURE_TYPE_BINARY} or * {@link Constants#SIGNATURE_TYPE_TEXTUAL}. *
*/ protected String signatureType = Constants.SIGNATURE_TYPE_BINARY; /** * The signature device to perform the actual signature. * ** May be {@link Constants#SIGNATURE_DEVICE_MOA} or * {@link Constants#SIGNATURE_DEVICE_BKU}. *
*/ protected String signatureDevice = Constants.SIGNATURE_DEVICE_MOA; /** * The signature profile identifier identifying the profile to be used in the * config file. * ** Note: In near future it will be possible to provide a full specified * profile here instead of the profile id. *
*/ protected String signatureProfileId = null; /** * The signature key identifier specifying which signature key should be used * by the signature device to perform the signature. * ** Providing a null value (default) means that no explicit signature key * identifier is provided. The selected signature device will then use its * default mechanism for retrieving this information (which is usually to read * the key from the provided signature profile). *
** Note that not all signature devices may support this parameter. * If a signature device doesn't support this parameter the value should be null. *
** This key is usually passed straight through to the signature device and * thereby has to contain an appropriate value for the signature device * chosen. *
** Currently, only the {@link Constants#SIGNATURE_DEVICE_MOA} signature device * evaluates this parameter and passes the provided String to MOA as the MOA * key group identifier. If null is provided, the MOA signature device will * determine the signature key identifier to be used from the provided profile * and, if not specified there either, from the MOA default configuration. *
*/ protected String signatureKeyIdentifier = null; /** * The signature position. Consult the PDF-AS documentation section * Commandline. */ protected SignaturePositioning signaturePositioning = null; /** * The output DataSink that will receive the signed document. */ protected DataSink output = null; protected TimeStamper timeStamperImpl; /** * */ protected boolean checkForPlaceholder; /** * The id of the placeholder which should be replaced. */ protected String placeholderId; /** * The matching mode for placeholder extraction.