at.gv.egiz.pdfas.api
Interface PdfAs

All Known Implementing Classes:
PdfAsObject

public interface PdfAs

The PDF-AS API main interface.

Create an Object implementing this interface using the proper factory.

Author:
wprinz, exthex

Method Summary
 AnalyzeResult analyze(AnalyzeParameters analyzeParameters)
          Analyzes a document for signatures and returns a verify-able list of such.
 DynamicSignatureProfile createDynamicSignatureProfile(String parentProfile, DynamicSignatureLifetimeEnum mode)
          Create a signature profile dynamically.
 DynamicSignatureProfile createDynamicSignatureProfile(String myUniqueName, String parentProfile, DynamicSignatureLifetimeEnum mode)
          Create a signature profile dynamically.
 DynamicSignatureProfile createEmptyDynamicSignatureProfile(DynamicSignatureLifetimeEnum mode)
          Create a signature profile dynamically.
 DynamicSignatureProfile createEmptyDynamicSignatureProfile(String myUniqueName, DynamicSignatureLifetimeEnum mode)
          Create a signature profile dynamically.
 SignResult finishSign(SignParameters signParameters, SignatureDetailInformation signatureDetailInformation)
          Finish the signature process.
 List getProfileInformation()
          Returns the list of information objects about activated profiles available in the configuration.
 DynamicSignatureProfile loadDynamicSignatureProfile(String profileName)
          Loads an existing dynamic signature profile by its name.
 SignatureDetailInformation prepareSign(SignParameters signParameters)
          Prepares the signature of the given PDF document.
 ReconstructXMLDsigResult reconstructXMLDSIG(ReconstructXMLDsigAfterAnalysisParameters reconstructXMLDsigParameters)
          Reconstruct the from the given parameters.
 ReconstructXMLDsigResult reconstructXMLDSIG(ReconstructXMLDsigParameters reconstructXMLDsigParameters)
          Reconstruct the from the given parameters.
 void reloadConfig()
          Reloads the configuration from the work directory.
 SignResult sign(SignParameters signParameters)
          Signs a PDF document using PDF-AS.
 SignResult sign(SignParameters signParameters, SignatureDetailInformation signatureDetailInformation)
          Signs a PDF document using PDF-AS.
 VerifyResults verify(VerifyAfterAnalysisParameters verifyAfterAnalysisParameters)
          Verifies a list of signatures that have been analyzed previously.
 VerifyResults verify(VerifyAfterReconstructXMLDsigParameters verifyAfterReconstructXMLDsigParameters)
          Verifies a list of signatures that have been analyzed previously and the xmldsigs have been reconstructed.
 VerifyResults verify(VerifyParameters verifyParameters)
          Verifies a document with (potentially multiple) PDF-AS signatures.
 

Method Detail

sign

SignResult sign(SignParameters signParameters)
                throws PdfAsException
Signs a PDF document using PDF-AS.

Parameters:
signParameters - The sign parameters.
Returns:
Returns the signed document plus additional information.
Throws:
PdfAsException - Thrown, if an error occurs.
See Also:
SignParameters, SignResult

sign

SignResult sign(SignParameters signParameters,
                SignatureDetailInformation signatureDetailInformation)
                throws PdfAsException
Signs a PDF document using PDF-AS.
This uses the SignatorInformation which was obtained by a call to prepareSign(SignParameters)

Parameters:
signParameters - The sign parameters.
signatureDetailInformation - The signature information which was previously obtained by a call to prepareSign(SignParameters)
Returns:
Returns the signed document plus additional information.
Throws:
PdfAsException - Thrown, if an error occurs.
See Also:
SignParameters, SignResult

verify

VerifyResults verify(VerifyParameters verifyParameters)
                     throws PdfAsException
Verifies a document with (potentially multiple) PDF-AS signatures.

Parameters:
verifyParameters - The verify parameters.
Returns:
Returns the verification results.
Throws:
PdfAsException - Thrown, if an error occurs.
See Also:
VerifyParameters, VerifyResults, VerifyResult

analyze

AnalyzeResult analyze(AnalyzeParameters analyzeParameters)
                      throws PdfAsException
Analyzes a document for signatures and returns a verify-able list of such.

Parameters:
analyzeParameters - The analyzation parameters.
Returns:
Returns a list of verify-able signatures that were found in the document.
Throws:
PdfAsException - Thrown on error.
See Also:
AnalyzeParameters, AnalyzeResult, #verify(AnalyzeResult)}

reconstructXMLDSIG

ReconstructXMLDsigResult reconstructXMLDSIG(ReconstructXMLDsigParameters reconstructXMLDsigParameters)
                                            throws PdfAsException
Reconstruct the from the given parameters.

Parameters:
reconstructXMLDsigParameters - The data from which to reconstruct the xmldsig
Returns:
a list of xmldsigs, one for each signature in the document
Throws:
PdfAsException - if the reconstruction fails

reconstructXMLDSIG

ReconstructXMLDsigResult reconstructXMLDSIG(ReconstructXMLDsigAfterAnalysisParameters reconstructXMLDsigParameters)
                                            throws PdfAsException
Reconstruct the from the given parameters.

Parameters:
reconstructXMLDsigParameters - The data from which to reconstruct the xmldsigs
Returns:
a list of xmldsigs, one for each signature in the document
Throws:
PdfAsException

verify

VerifyResults verify(VerifyAfterAnalysisParameters verifyAfterAnalysisParameters)
                     throws PdfAsException
Verifies a list of signatures that have been analyzed previously.

Parameters:
verifyAfterAnalysisParameters - The parameters.
Returns:
Returns the verification results.
Throws:
PdfAsException - Thrown on error.
See Also:
AnalyzeResult, VerifyAfterAnalysisParameters, VerifyResults, VerifyResult, #analyze(AnalyzeParameters)}

verify

VerifyResults verify(VerifyAfterReconstructXMLDsigParameters verifyAfterReconstructXMLDsigParameters)
                     throws PdfAsException
Verifies a list of signatures that have been analyzed previously and the xmldsigs have been reconstructed.

Parameters:
verifyAfterReconstructXMLDsigParameters - The parameters.
Returns:
the verification results.
Throws:
PdfAsException - Thrown on error.

reloadConfig

void reloadConfig()
                  throws PdfAsException
Reloads the configuration from the work directory.

Throws:
PdfAsException - Thrown, if an error occurs.

getProfileInformation

List getProfileInformation()
                           throws PdfAsException
Returns the list of information objects about activated profiles available in the configuration.

Note: Currently the profile information consists of the profile Id and the MOA Key Id only.

Note: In near future the profile management will be moved out of the config file into an API class representation of the profiles which may render this (and related) methods obsolete.

Returns:
Returns the list of SignatureProfile objects with information about active profiles available in the configuration.
Throws:
PdfAsException - Thrown on error.
See Also:
SignatureProfile

createDynamicSignatureProfile

DynamicSignatureProfile createDynamicSignatureProfile(String parentProfile,
                                                      DynamicSignatureLifetimeEnum mode)
Create a signature profile dynamically. You have do apply() it for usage. See SignatureProfile.

Parameters:
parentProfile - a parent profile id to inherit all properties
mode - lifetime mode
Returns:
the created signature profile to work with.

createDynamicSignatureProfile

DynamicSignatureProfile createDynamicSignatureProfile(String myUniqueName,
                                                      String parentProfile,
                                                      DynamicSignatureLifetimeEnum mode)
Create a signature profile dynamically. You have to provide a unique name and have do apply() it for usage. See SignatureProfile. It is recommended to use createDynamicSignatureProfile(String, DynamicSignatureLifetimeEnum) that generates a unique name on its own.

Parameters:
parentProfile - a parent profile id to inherit all properties
myUniqueName - a unique name for the profile
mode - lifetime mode
Returns:
the created signature profile to work with.
See Also:
DynamicSignatureProfile

createEmptyDynamicSignatureProfile

DynamicSignatureProfile createEmptyDynamicSignatureProfile(DynamicSignatureLifetimeEnum mode)
Create a signature profile dynamically. You have fill it with properties and apply() it for usage. See SignatureProfile.
It is recommended to use createDynamicSignatureProfile(String, DynamicSignatureLifetimeEnum) that inherits from an existing profile saving you a lot of work.

Parameters:
mode - lifetime mode
Returns:
the created signature profile to work with.
See Also:
DynamicSignatureProfile

createEmptyDynamicSignatureProfile

DynamicSignatureProfile createEmptyDynamicSignatureProfile(String myUniqueName,
                                                           DynamicSignatureLifetimeEnum mode)
Create a signature profile dynamically. You have fill it with properties and apply() it for usage. See SignatureProfile.
It is recommended to use createDynamicSignatureProfile(String, DynamicSignatureLifetimeEnum) that inherits from an existing profile saving you a lot of work.

Parameters:
myUniqueName - a unique name for the profile
mode - lifetime mode
Returns:
the created signature profile to work with.

loadDynamicSignatureProfile

DynamicSignatureProfile loadDynamicSignatureProfile(String profileName)
Loads an existing dynamic signature profile by its name. Profiles are saved when they are applied and it has DynamicSignatureLifetimeEnum.MANUAL

Parameters:
profileName -
Returns:
the signature profile or null if not found.
See Also:
DynamicSignatureProfile

prepareSign

SignatureDetailInformation prepareSign(SignParameters signParameters)
                                       throws PdfAsException
Prepares the signature of the given PDF document. The table for the signature data is placed but not filled.
Usually used for preview.

Parameters:
signParameters - The sign parameters.
Returns:
Only the SignatureDetailInformation.getSignaturePosition(), SignatureDetailInformation.getNonTextualObjects(), SignatureDetailInformation.getSignatureData() are filled.
Throws:
PdfAsException - if something goes wrong during the process

finishSign

SignResult finishSign(SignParameters signParameters,
                      SignatureDetailInformation signatureDetailInformation)
                      throws PdfAsException
Finish the signature process. The PDF is filled with the signature data.
Usually used if some steps like the actual signing are to be performed externally.

Parameters:
signParameters - The sign parameters.
signatureDetailInformation - The signature detail information.
Returns:
Throws:
PdfAsException


Copyright © 2006-2011. All Rights Reserved.