at.gv.egiz.pdfas.api.sign
Class SignParameters

java.lang.Object
  extended by at.gv.egiz.pdfas.api.sign.SignParameters

public class SignParameters
extends Object

Parameter object that holds the sign parameters.

Author:
wprinz

Field Summary
protected  Boolean checkForPlaceholder
          The flag to de-/activate placeholder search
protected  DataSource document
          The document to be signed.
protected  DataSink output
          The output DataSink that will receive the signed document.
protected  Properties overrideProps
           
protected  String placeholderId
          The id of the placeholder which should be replaced.
protected  int placeholderMatchMode
          The matching mode for placeholder extraction.
protected  String signatureDevice
          The signature device to perform the actual signature.
protected  String signatureKeyIdentifier
          The signature key identifier specifying which signature key should be used by the signature device to perform the signature.
protected  SignaturePositioning signaturePositioning
          The signature position.
protected  String signatureProfileId
          The signature profile identifier identifying the profile to be used in the config file.
protected  String signatureType
          The type of the signature.
protected  TimeStamper timeStamperImpl
           
 
Constructor Summary
SignParameters()
           
 
Method Summary
 DataSource getDocument()
           
 DataSink getOutput()
           
 String getPlaceholderId()
          The id of the placeholder to replace.
 int getPlaceholderMatchMode()
          Get the placeholder matching mode.
 Properties getProfileOverrideProperties()
          Get override values created via setProfileOverrideValue(String, String)
 String getSignatureDevice()
           
 String getSignatureKeyIdentifier()
           
 SignaturePositioning getSignaturePositioning()
           
 String getSignatureProfileId()
           
 String getSignatureType()
           
 TimeStamper getTimeStamperImpl()
          setTimeStamperImpl(TimeStamper)
 Boolean isCheckForPlaceholder()
          Get the value of the checkForPlaceholder flag.
 void setCheckForPlaceholder(boolean check)
          Set this to true, if you want a search for placeholder images to be performed and appropriate images to be replaced.
 void setDocument(DataSource document)
           
 void setOutput(DataSink output)
           
 void setPlaceholderId(String placeholderId)
          Set an explicit placeholder id.
 void setPlaceholderMatchMode(int placeholderMatchMode)
          Set the behavior if no exactly matching placeholder could be found.
 void setProfileOverrideValue(String key, String value)
          Override user defined values from the used signature profile like "value.SIG_META".
 void setSignatureDevice(String signatureDevice)
           
 void setSignatureKeyIdentifier(String signatureKeyIdentifier)
           
 void setSignaturePositioning(SignaturePositioning signaturePositioning)
           
 void setSignatureProfileId(String signatureProfileId)
           
 void setSignatureType(String signatureType)
           
 void setTimeStamperImpl(TimeStamper timeStamperImpl)
          Set a TimeStamper to create a timestamp on the signature value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

document

protected DataSource document
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


signatureType

protected String signatureType
The type of the signature.

May be Constants.SIGNATURE_TYPE_BINARY or Constants.SIGNATURE_TYPE_TEXTUAL.


signatureDevice

protected String signatureDevice
The signature device to perform the actual signature.

May be Constants.SIGNATURE_DEVICE_MOA or Constants.SIGNATURE_DEVICE_BKU.


signatureProfileId

protected String signatureProfileId
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.


signatureKeyIdentifier

protected String signatureKeyIdentifier
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 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.


signaturePositioning

protected SignaturePositioning signaturePositioning
The signature position. Consult the PDF-AS documentation section Commandline.


output

protected DataSink output
The output DataSink that will receive the signed document.


timeStamperImpl

protected TimeStamper timeStamperImpl

checkForPlaceholder

protected Boolean checkForPlaceholder
The flag to de-/activate placeholder search


placeholderId

protected String placeholderId
The id of the placeholder which should be replaced.


placeholderMatchMode

protected int placeholderMatchMode
The matching mode for placeholder extraction.
If a placeholderId is set, the match mode determines what is to be done, if no matching placeholder is found in the document.
Defaults to Constants.PLACEHOLDER_MATCH_MODE_MODERATE.


overrideProps

protected Properties overrideProps
Constructor Detail

SignParameters

public SignParameters()
Method Detail

getTimeStamperImpl

public TimeStamper getTimeStamperImpl()
setTimeStamperImpl(TimeStamper)

Returns:

setTimeStamperImpl

public void setTimeStamperImpl(TimeStamper timeStamperImpl)
Set a TimeStamper to create a timestamp on the signature value. Will be called after sign. For binary signatures only. Timestamp will be embedded in egiz dict /TimeStamp.

Parameters:
timeStamperImpl -

getDocument

public DataSource getDocument()
Returns:
the document

setDocument

public void setDocument(DataSource document)
Parameters:
document - the document to set

getSignatureType

public String getSignatureType()
Returns:
the signatureType

setSignatureType

public void setSignatureType(String signatureType)
Parameters:
signatureType - the signatureType to set

getSignatureDevice

public String getSignatureDevice()
Returns:
the signatureDevice

setSignatureDevice

public void setSignatureDevice(String signatureDevice)
Parameters:
signatureDevice - the signatureDevice to set

getSignatureProfileId

public String getSignatureProfileId()
Returns:
the signatureProfileId

setSignatureProfileId

public void setSignatureProfileId(String signatureProfileId)
Parameters:
signatureProfileId - the signatureProfileId to set

getSignaturePositioning

public SignaturePositioning getSignaturePositioning()
Returns:
the signaturePositioning

setSignaturePositioning

public void setSignaturePositioning(SignaturePositioning signaturePositioning)
Parameters:
signaturePositioning - the signaturePositioning to set

getOutput

public DataSink getOutput()
Returns:
the output

setOutput

public void setOutput(DataSink output)
Parameters:
output - the output to set

getSignatureKeyIdentifier

public String getSignatureKeyIdentifier()
Returns:
the signatureKeyIdentifier

setSignatureKeyIdentifier

public void setSignatureKeyIdentifier(String signatureKeyIdentifier)
Parameters:
signatureKeyIdentifier - the signatureKeyIdentifier to set

setProfileOverrideValue

public void setProfileOverrideValue(String key,
                                    String value)
Override user defined values from the used signature profile like "value.SIG_META". You cannot override pre defined values like SIG_VALUE, SIG_DATE SignatureTypes.REQUIRED_SIG_KEYS. The override values are bound to the SignParameters instance.

Sample usage:

      SignParameters sp = new SignParameters();
      . . .

      sp.setSignatureProfileId("SIGNATURBLOCK_DE");  

      // expressions do not work on binary signature fields without phlength setting!!
      sp.setProfileOverrideValue("SIG_META", "It's nice to be important, but it is more important to be nice ${subject.L}");;
      sp.setProfileOverrideValue("SIG_LABEL", "./images/signatur-logo_en.png");                  

      // execute sign using the overrides
      pdfAs.sign(sp);
  

Parameters:
key - the name of the setting to override e.g. "SIG_META"
value - The new value

getProfileOverrideProperties

public Properties getProfileOverrideProperties()
Get override values created via setProfileOverrideValue(String, String)

Returns:

isCheckForPlaceholder

public Boolean isCheckForPlaceholder()
Get the value of the checkForPlaceholder flag.

Returns:

setCheckForPlaceholder

public void setCheckForPlaceholder(boolean check)
Set this to true, if you want a search for placeholder images to be performed and appropriate images to be replaced. If this is not set, a search will only be performed if the configuration property "enable_placeholder_search" is set to true.

Parameters:
check -

setPlaceholderId

public void setPlaceholderId(String placeholderId)
Set an explicit placeholder id. Only placeholder images that have a matching ID property embedded will be considered for replacement.

Parameters:
placeholderId -

getPlaceholderId

public String getPlaceholderId()
The id of the placeholder to replace.

Returns:
the placeholderId

setPlaceholderMatchMode

public void setPlaceholderMatchMode(int placeholderMatchMode)
Set the behavior if no exactly matching placeholder could be found.
Exactly matching meaning:

Parameters:
placeholderMatchMode -
See Also:
Constants.PLACEHOLDER_MATCH_MODE_LENIENT, Constants.PLACEHOLDER_MATCH_MODE_MODERATE, Defaults to {@link Constants#PLACEHOLDER_MATCH_MODE_MODERATE}.

getPlaceholderMatchMode

public int getPlaceholderMatchMode()
Get the placeholder matching mode.

Returns:
the placeholderMatchMode
See Also:
getPlaceholderMatchMode()


Copyright © 2006-2011. All Rights Reserved.