From ebf049402a10f8a4cf5612496d5c6daf64a7081a Mon Sep 17 00:00:00 2001 From: pdanner Date: Mon, 6 Dec 2010 18:02:38 +0000 Subject: Added javadoc git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@689 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- src/main/java/at/gv/egiz/pdfas/api/PdfAs.java | 15 +++++++--- .../impl/api/internal/PdfAsInternalObject.java | 32 +++++++++++++++++++++- 2 files changed, 42 insertions(+), 5 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/at/gv/egiz/pdfas/api/PdfAs.java b/src/main/java/at/gv/egiz/pdfas/api/PdfAs.java index 66035db..26bbace 100644 --- a/src/main/java/at/gv/egiz/pdfas/api/PdfAs.java +++ b/src/main/java/at/gv/egiz/pdfas/api/PdfAs.java @@ -7,6 +7,7 @@ import java.util.List; import at.gv.egiz.pdfas.api.analyze.AnalyzeParameters; import at.gv.egiz.pdfas.api.analyze.AnalyzeResult; +import at.gv.egiz.pdfas.api.analyze.NonTextObjectInfo; import at.gv.egiz.pdfas.api.commons.DynamicSignatureLifetimeEnum; import at.gv.egiz.pdfas.api.commons.DynamicSignatureProfile; import at.gv.egiz.pdfas.api.commons.SignatureProfile; @@ -14,6 +15,7 @@ import at.gv.egiz.pdfas.api.exceptions.PdfAsException; import at.gv.egiz.pdfas.api.sign.SignParameters; import at.gv.egiz.pdfas.api.sign.SignResult; import at.gv.egiz.pdfas.api.sign.SignatureDetailInformation; +import at.gv.egiz.pdfas.api.sign.pos.SignaturePosition; import at.gv.egiz.pdfas.api.verify.VerifyAfterAnalysisParameters; import at.gv.egiz.pdfas.api.verify.VerifyAfterReconstructXMLDsigParameters; import at.gv.egiz.pdfas.api.verify.VerifyParameters; @@ -231,19 +233,24 @@ public interface PdfAs public DynamicSignatureProfile loadDynamicSignatureProfile(String profileName); /** - * TODO doc + * Prepares the signature of the given PDF document. The table for the signature data is placed but not filled.
+ * Usually used for preview. * * @param signParameters - * @return - * @throws PdfAsException + * The sign parameters. + * @return Only the {@link SignatureDetailInformation#getSignaturePosition()}, {@link SignatureDetailInformation#getNonTextualObjects()}, {@link SignatureDetailInformation#getSignatureData()} are filled. + * @throws PdfAsException if something goes wrong during the process */ public SignatureDetailInformation prepareSign(SignParameters signParameters) throws PdfAsException; /** - * TODO doc + * 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. * * @param signParameters + * The sign parameters. * @param signatureDetailInformation + * The signature detail information. * @return * @throws PdfAsException */ diff --git a/src/main/java/at/gv/egiz/pdfas/impl/api/internal/PdfAsInternalObject.java b/src/main/java/at/gv/egiz/pdfas/impl/api/internal/PdfAsInternalObject.java index c457bd3..4e36c24 100644 --- a/src/main/java/at/gv/egiz/pdfas/impl/api/internal/PdfAsInternalObject.java +++ b/src/main/java/at/gv/egiz/pdfas/impl/api/internal/PdfAsInternalObject.java @@ -64,6 +64,7 @@ import at.knowcenter.wag.egov.egiz.sig.signaturelayout.SignatureLayoutHandlerFac import at.knowcenter.wag.egov.egiz.sig.signatureobject.SignatureObjectHelper; /** + * @see PdfAsInternal * * @author mmocnik * @@ -74,11 +75,17 @@ public class PdfAsInternalObject implements PdfAsInternal { */ private static Log log = LogFactory.getLog(CheckHelper.class); + /** + * @see PdfAsInternal#verifyBKUSupport(LocalBKUParams) + */ public void verifyBKUSupport(LocalBKUParams bkuParams) throws ConnectorException, SettingsException { String bkuIdentifier = BKUHelper.getBKUIdentifier(bkuParams); SignatureLayoutHandlerFactory.verifyBKUSupport(bkuIdentifier); } + /** + * @see PdfAsInternal#finishLocalSign(PdfAs, SignParameters, SignatureDetailInformation, LocalBKUParams, String) + */ public SignResult finishLocalSign(PdfAs pdfAs, SignParameters signParameters, SignatureDetailInformation sdi, LocalBKUParams bkuParams, String xmlResponse) throws PdfAsException { LocalConnector c = chooseLocalConnectorForSign(signParameters.getSignatureDevice(), signParameters.getSignatureProfileId(), "not needed"); SignSignatureObject sso = c.analyzeSignResponse(buildResponseProperties(bkuParams, xmlResponse)); @@ -179,7 +186,9 @@ public class PdfAsInternalObject implements PdfAsInternal { throw new ConnectorException(ErrorCode.UNSUPPORTED_SIGNATURE, "The SIG_KZ version '" + sig_kz.getVersion() + "' is unknown."); } - + /** + * @see PdfAsInternal#getLocalServiceAddress(String, String) + */ public String getLocalServiceAddress(String profile, String device) throws SettingsException { SettingsReader settings = SettingsReader.getInstance(); @@ -192,6 +201,9 @@ public class PdfAsInternalObject implements PdfAsInternal { return value; } + /** + * @see PdfAsInternal#prepareLocalSignRequest(SignParameters, String, SignatureDetailInformation) + */ public String prepareLocalSignRequest(SignParameters signParameters, String loc_ref_url, SignatureDetailInformation sdi) throws ConnectorException { LocalConnector c = chooseLocalConnectorForSign(signParameters.getSignatureDevice(), signParameters.getSignatureProfileId(), loc_ref_url); @@ -200,6 +212,9 @@ public class PdfAsInternalObject implements PdfAsInternal { return sign_request; } + /** + * @see PdfAsInternal#analyzeFromRawText(String, Map) + */ public AnalyzeResult analyzeFromRawText(String rawText, Map sigValues) throws SignatureException, SettingsException, SignatureTypesException, NormalizeException { String normalizedText = PdfAS.normalizeText(rawText); @@ -225,6 +240,9 @@ public class PdfAsInternalObject implements PdfAsInternal { return ret; } + /** + * @see PdfAsInternal#prepareLocalVerifyRequest(SignatureInformation, String, String, String) + */ public String prepareLocalVerifyRequest(SignatureInformation sigInfo, String connector, String profile, String loc_ref_url) throws SignatureException, ConnectorException { SignatureHolder holder = (SignatureHolder)sigInfo.getInternalSignatureInformation(); @@ -240,6 +258,9 @@ public class PdfAsInternalObject implements PdfAsInternal { return request_string; } + /** + * @see PdfAsInternal#finishLocalVerify(SignatureInformation, String, String, String, String) + */ public VerifyResult finishLocalVerify(SignatureInformation sigInfo, String connector, String profile, String loc_ref_url, String xmlResponse) throws SignatureException, ConnectorException { SignatureHolder holder = (SignatureHolder)sigInfo.getInternalSignatureInformation(); SignatureObject s = holder.getSignatureObject(); @@ -254,6 +275,9 @@ public class PdfAsInternalObject implements PdfAsInternal { return new VerifyResultAdapter(sigResponse, holder, null); } + /** + * @see PdfAsInternal#getSignatureEntryFromSignatureInformation(String, SignatureInformation) + */ public SignatureEntry getSignatureEntryFromSignatureInformation(String key, SignatureInformation sigInfo) { @@ -268,6 +292,9 @@ public class PdfAsInternalObject implements PdfAsInternal { return ret; } + /** + * @see PdfAsInternal#getSignedText(SignatureInformation) + */ public String getSignedText(SignatureInformation sigInfo) { SignatureHolder holder = (SignatureHolder)sigInfo.getInternalSignatureInformation(); if (holder instanceof TextualSignatureHolder) @@ -275,6 +302,9 @@ public class PdfAsInternalObject implements PdfAsInternal { return null; } + /** + * @see PdfAsInternal#getConnectorsAvailableForWeb() + */ public Map getConnectorsAvailableForWeb() throws ConnectorFactoryException { ConnectorInformation ci[] = ConnectorFactory.getConnectorInformationArray(); -- cgit v1.2.3