at.gv.egiz.pdfas.impl.signator.binary
Class BinarySignator_1_0_0

java.lang.Object
  extended byat.gv.egiz.pdfas.impl.signator.binary.BinarySignator_1_0_0
All Implemented Interfaces:
Signator
Direct Known Subclasses:
BinarySignator_1_1_0

public class BinarySignator_1_0_0
extends Object
implements Signator

Signs the document binary.

In prepareSign, an Incremental Update is created that contains the Signature block and the egiz dictionary. For formatting the layout, variable values are filled with placeholders. After the layout has been fixed, all variable fields (all holes in the byte ranges) are replaced with 0. This document is then base64 encoded and signed.

In finishSign, the variable fields (values, /Cert) are replaced with the values according to the encoding.

Author:
wprinz

Field Summary
static PdfASID MY_ID
          The Pdf-AS ID of this Signator.
static String SIG_BAIK_ENABLED
          Settings key for baik enables signatures
 
Constructor Summary
BinarySignator_1_0_0()
          Default constructor.
 
Method Summary
protected  BinarySignatorInformation compressIUI(IncrementalUpdateInformation iui)
           
protected  void fillReplacesWithValues(IncrementalUpdateInformation iui)
          Reads the signature values from the signed signature object and fills the corresponding value in the Replaces array.
 void finishSign(SignatorInformation signatorInformation, DataSink dataSink)
           
protected  SignatureData formSignatureData(IncrementalUpdateInformation iui)
          Forms the SignatureData to be used for signing.
 String getEncoding()
          Suppies encoding for text extraction
 PdfASID getMyId()
          Returns the PdfASID of this Connector.
 SignatorInformation prepareSign(PdfDataSource pdfDataSource, String profile, TablePos pos, TimeStamper timeStamper)
           
protected  void restoreSignedPdf(IncrementalUpdateInformation iui)
           
protected  IncrementalUpdateInformation uncompressIUI(BinarySignatorInformation bsi)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIG_BAIK_ENABLED

public static final String SIG_BAIK_ENABLED
Settings key for baik enables signatures

See Also:
Constant Field Values

MY_ID

public static final PdfASID MY_ID
The Pdf-AS ID of this Signator.

Constructor Detail

BinarySignator_1_0_0

public BinarySignator_1_0_0()
Default constructor.

Method Detail

getMyId

public PdfASID getMyId()
Description copied from interface: Signator
Returns the PdfASID of this Connector.

This should always return the MY_ID static field of the connector. Dont't forget to override this.

Within connector code always use this method so that code reuse through derivation can take place correctly.

Specified by:
getMyId in interface Signator
Returns:
Returns the PdfASID of this Connector.
See Also:
Signator.getMyId()

prepareSign

public SignatorInformation prepareSign(PdfDataSource pdfDataSource,
                                       String profile,
                                       TablePos pos,
                                       TimeStamper timeStamper)
                                throws SignatorException
Specified by:
prepareSign in interface Signator
Throws:
SignatorException
See Also:
Signator.prepareSign(PdfDataSource, String, TablePos, TimeStamper)

finishSign

public void finishSign(SignatorInformation signatorInformation,
                       DataSink dataSink)
                throws SignatorException
Specified by:
finishSign in interface Signator
Throws:
SignatorException
See Also:
Signator.finishSign(at.gv.egiz.pdfas.framework.signator.SignatorInformation, at.gv.egiz.pdfas.framework.output.DataSink)

fillReplacesWithValues

protected void fillReplacesWithValues(IncrementalUpdateInformation iui)
Reads the signature values from the signed signature object and fills the corresponding value in the Replaces array.

Parameters:
iui - The IncrementalUpdateInformation.

formSignatureData

protected SignatureData formSignatureData(IncrementalUpdateInformation iui)
Forms the SignatureData to be used for signing.

Parameters:
iui - The IncrementalUpdateInformation.
Returns:
Returns the SignatureData to be used for signing.

compressIUI

protected BinarySignatorInformation compressIUI(IncrementalUpdateInformation iui)

uncompressIUI

protected IncrementalUpdateInformation uncompressIUI(BinarySignatorInformation bsi)

restoreSignedPdf

protected void restoreSignedPdf(IncrementalUpdateInformation iui)

getEncoding

public String getEncoding()
Description copied from interface: Signator
Suppies encoding for text extraction

Specified by:
getEncoding in interface Signator
Returns:


Copyright © 2006-2010. All Rights Reserved.