From b7d2f32fb8673f82602b7e937815c39a8df2193c Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 10 Apr 2013 18:49:37 +0000 Subject: PDFSignator Interface changes git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@5 174cde9d-5d70-4d2a-aa98-46368bc2aaf7 --- .../pdfover/pdfsignator/PDFSignatorInterface.java | 9 +- .../asit/pdfover/pdfsignator/SignedDocument.java | 13 - .../src/model/PDFSignatorInterface.ucd | 18 +- .../model/pdf-signer-interface.uml | 485 ++++++++++ .../src/model/PDFSignerInterface.ucd | 228 ++--- .../src/model/images/PDFSignerInterface.svg | 976 +++++++++------------ 6 files changed, 991 insertions(+), 738 deletions(-) delete mode 100644 pdf-over/pdf-signator-interface/src/main/java/at/asit/pdfover/pdfsignator/SignedDocument.java create mode 100644 pdf-over/pdf-signer-interface/model/pdf-signer-interface.uml diff --git a/pdf-over/pdf-signator-interface/src/main/java/at/asit/pdfover/pdfsignator/PDFSignatorInterface.java b/pdf-over/pdf-signator-interface/src/main/java/at/asit/pdfover/pdfsignator/PDFSignatorInterface.java index d75cc536..094d7523 100644 --- a/pdf-over/pdf-signator-interface/src/main/java/at/asit/pdfover/pdfsignator/PDFSignatorInterface.java +++ b/pdf-over/pdf-signator-interface/src/main/java/at/asit/pdfover/pdfsignator/PDFSignatorInterface.java @@ -3,10 +3,11 @@ */ package at.asit.pdfover.pdfsignator; +import java.security.SignatureException; + +import at.asit.pdfover.pdfsigner.PDFSignatureException; import at.asit.pdfover.pdfsigner.SignResult; import at.asit.pdfover.pdfsigner.SignatureParameter; -import at.asit.pdfover.pdfsigner.SLRequest; -import at.asit.pdfover.pdfsigner.SLResponse; import at.asit.pdfover.pdfsigner.SigningState; /** @@ -28,12 +29,12 @@ public interface PDFSignatorInterface { * @param parameter The signature parameter * @return A Signature State for the signing library */ - public SigningState SignPrepare(SignatureParameter parameter); + public SigningState SignPrepare(SignatureParameter parameter) throws PDFSignatureException; /** * Performs the signature * @param response The signing state * @return The signed document */ - public SignResult SignPerform(SigningState state); + public SignResult SignPerform(SigningState state) throws PDFSignatureException; } diff --git a/pdf-over/pdf-signator-interface/src/main/java/at/asit/pdfover/pdfsignator/SignedDocument.java b/pdf-over/pdf-signator-interface/src/main/java/at/asit/pdfover/pdfsignator/SignedDocument.java deleted file mode 100644 index 1c8c28fe..00000000 --- a/pdf-over/pdf-signator-interface/src/main/java/at/asit/pdfover/pdfsignator/SignedDocument.java +++ /dev/null @@ -1,13 +0,0 @@ -/** - * - */ -package at.asit.pdfover.pdfsignator; - -/** - * Represents a Signed Document - * - * @author afitzek - */ -public class SignedDocument { - -} diff --git a/pdf-over/pdf-signator-interface/src/model/PDFSignatorInterface.ucd b/pdf-over/pdf-signator-interface/src/model/PDFSignatorInterface.ucd index 2ed18b62..2a011e93 100644 --- a/pdf-over/pdf-signator-interface/src/model/PDFSignatorInterface.ucd +++ b/pdf-over/pdf-signator-interface/src/model/PDFSignatorInterface.ucd @@ -1,12 +1,6 @@ - - - - - - - - + + @@ -14,14 +8,14 @@ - + - - + + - + diff --git a/pdf-over/pdf-signer-interface/model/pdf-signer-interface.uml b/pdf-over/pdf-signer-interface/model/pdf-signer-interface.uml new file mode 100644 index 00000000..9e849a28 --- /dev/null +++ b/pdf-over/pdf-signer-interface/model/pdf-signer-interface.uml @@ -0,0 +1,485 @@ + + + + + + + + + + A Document Source +@author afitzek + + + + + base class for signature exceptions +@author afitzek + + + + + + + + + + + + The Dimensions of the visible signature block +@author afitzek + + + + The visible Signature block height + + + + + + + + The visible Signature block width + + + + + + + + Sets the width for the dimension +@param value + + + + + + + + Gets the width of the visible Signature block +@return + + + + + + + + Constructor +@param width The width of the signature block +@param height The height of the signature block + + + + + + + + + + + Sets the height for the dimension +@param value + + + + + + + + Gets the height of the visible Signature block +@return + + + + + + + + + Securtiy Layer Response +@author afitzek + + + + + + The state of the pdf signing library +@author afitzek + + + + Gets the Security Layer Request to create the signature +@return The SL Signature Request + + + + + + Sets the Security Layer Request to create the signature +@param value The SL Signature Request + + + + + + + Securtiy Layer Request +@author afitzek + + + + Gets the signature data for this request +@return The document source + + + + + + + The Signature Parameter +@author afitzek + + + + holds the collimating mark + + + + + + + The signature Device + + + + + + + + The signature Device + + + + + + + + The Signature Position + + + + + + + + Getter of the property <tt>signaturePosition</tt> +@return Returns the signaturePosition. + + + + + + Setter of the property <tt>documentSource</tt> +@param value The documentSource to set. + + + + + + Setter of the property <tt>KeyIdentifier</tt> +@param value The KeyIdentifier to set. + + + + + + Gets the collimating mark +@return + + + + + + Getter of the property <tt>documentSource</tt> +@return Returns the documentSource. + + + + + + Setter of the property <tt>signaturePosition</tt> +@param signaturePosition The signaturePosition to set. + + + + + + Sets the collimating mark +@param value The new colimating mark + + + + + + Gets the Dimension to display the Placeholder +@return the placeholder dimensions + + + + + + Getter of the property <tt>KeyIdentifier</tt> +@return Returns the KeyIdentifier. + + + + + + + Represents the position of a visible signature block +@author afitzek + + + + The page value of the position + + + + + + + + + The y value of the position + + + + + + + + + The x value of the position + + + + + + + + + Constructor +@param x The x value of the position +@param y The y value of the position +@param page The page value of the position + + + + + + + + + + + + + + X - Y Constructor Page = 1 +@param x The x value of the position +@param y The y value of the position + + + + + + + + + + + Gets the Y value of the position +@return int the y value of the position + + + + + + + + Sets X value of position +@param value the new x value + + + + + + + + Default constructor + + + + + Sets Y value of position +@param value the new y value + + + + + + + + Gets the Page value of the position +@return int the page value of the position + + + + + + + + Sets Page value of position +@param value the new page value + + + + + + + + Gets the X value of the position +@return int the x value of the position + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Signature Result containing the signed document as document source +@author afitzek + + + + Getter of the property <tt>signaturePosition</tt> +@return Returns the signaturePosition. + + + + + + Gets the signer certificate +@return The signer x509 certificate + + + + + + Gets the signed Document +@return Returns the documentSource. + + + + + + + PDF Signator base Class +This class should be extended to support PDF-AS and PADES. +@author afitzek + + + + Adds the signature to the document. +The SL Response has to be set in the state +@param state The siging state +@return The signature Result +@throws SignatureException + + + + + + + Prepare a signature +Defines signature parameters, the pdf library prepares the pdf document to sign and +creates a Security Layer Request. +@param parameter The signature parameters +@return The siging state (contains the prepared document and the signature request +@throws SignatureException + + + + + + + Creates new signing profile +@param base The profile id of the base profile +@param profileID The id of the new profile +@return The new Profile + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pdf-over/pdf-signer-interface/src/model/PDFSignerInterface.ucd b/pdf-over/pdf-signer-interface/src/model/PDFSignerInterface.ucd index cb7e79f8..450dd84c 100644 --- a/pdf-over/pdf-signer-interface/src/model/PDFSignerInterface.ucd +++ b/pdf-over/pdf-signer-interface/src/model/PDFSignerInterface.ucd @@ -1,118 +1,49 @@ - - + + - - + - - - - - - - - - - - - - - - - + - + - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - - - - - - - - - + + - + - + - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - + - + @@ -122,81 +53,84 @@ - + - - + + + + + + + + + + + + - - - - - - - - - + - + - + - - - + + + - - + + - + - + - - - - + + + + + + + + + + - - - - - - - - - + + + + + + + + + - + - + + - - - - - - - + + + + + + + - - - - - - - + - + diff --git a/pdf-over/pdf-signer-interface/src/model/images/PDFSignerInterface.svg b/pdf-over/pdf-signer-interface/src/model/images/PDFSignerInterface.svg index 37daf2cc..a1cd1ccf 100644 --- a/pdf-over/pdf-signer-interface/src/model/images/PDFSignerInterface.svg +++ b/pdf-over/pdf-signer-interface/src/model/images/PDFSignerInterface.svg @@ -6,404 +6,290 @@ - + - + + + + + - + - + - + - + - + - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - - - - - - - - + + + + + + + + + - - + - GetPreparedDocument(): DocumentSource - - GetSLSignatureRequest(): SLRequest + + - GetSLSignatureRequest(): SLRequest - - - SetSLSignatureResponse(in value: SLResponse) + SetSLSignatureResponse(in value: SLResponse) - - SigningState - «interface» - - - - - - - - - +AePHCpr1OuFARGzgGAaHryNx48qOf+E/sN/1drCXjgudMwAAAABJRU5ErkJggg==" style="clip-path:url(#clipPath5);" height="16" preserveAspectRatio="none" /> + SigningState + «interface» + + + + + + + + + - - - GetCollimatingMark(): CollimatingMark - - + - GetInputDocument(): DocumentSource - - - GetKeyIdentifier(): String - - - GetPlaceholderDimension(): SignatureDimension - - + GetParameter(): SignatureParameter + + - GetSignaturePosition(): SignaturePosition - - - SetCollimatingMark(in value: CollimatingMark) - - - SetInputDocument(in value: DocumentSource) - - - SetKeyIdentifier(in value: String) - - + Prepare(in parameter: SignatureParameter): SigningState + + - SetSignaturePosition(in signaturePosition: SignaturePosition) +NCkDAO6kJdrlZ1J0AAAAAElFTkSuQmCC" style="clip-path:url(#clipPath10); fill:rgb(0,127,0); stroke:rgb(0,127,0);" height="16" preserveAspectRatio="none" /> + Sign(in state: SigningState): SignResult - - SignatureParameter - - - - - - - - - + + PDFSignerInterface + «interface» + + + + + + + + + - - - GetPage(): int - - - GetX(): int - - - GetY(): int - - - SetPage(in value: int) - - - SetX(in value: int) - - + - SetY(in value: int) - - - SignaturePosition(in x: int, in y: int, in page: int) - - - SignaturePosition(in x: int, in y: int) - - - SignaturePosition() +NCkDAO6kJdrlZ1J0AAAAAElFTkSuQmCC" style="clip-path:url(#clipPath14); fill:rgb(0,127,0); stroke:rgb(0,127,0);" height="16" preserveAspectRatio="none" /> + GetSignatureData(): DocumentSource - + SLRequest + + + + + + + + - SignaturePosition - - - - - - - - - +2Xri8wlLCDAAAAAASUVORK5CYII=" style="clip-path:url(#clipPath17);" height="16" preserveAspectRatio="none" /> + SLResponse + + + + + + + + + - - + - GetParameter(): SignatureParameter - - + GetSignaturePosition(): SignaturePosition + + - Prepare(in parameter: SignatureParameter): SigningState - - + GetSignedDocument(): DocumentSource + + - Sign(in state: SigningState): SignResult +NCkDAO6kJdrlZ1J0AAAAAElFTkSuQmCC" style="clip-path:url(#clipPath21); fill:rgb(0,127,0); stroke:rgb(0,127,0);" height="16" preserveAspectRatio="none" /> + GetSignerCertificate(): Certificate - - PDFSignerInterface - «interface» - - - - - - - - - +AePHCpr1OuFARGzgGAaHryNx48qOf+E/sN/1drCXjgudMwAAAABJRU5ErkJggg==" style="clip-path:url(#clipPath22);" height="16" preserveAspectRatio="none" /> + SignResult + «interface» + + + + + + + + + - - + - GetHeight(): int - - + GetHeight(): int + + - GetWidth(): int - - + GetWidth(): int + + - SetHeight(in value: int) - - + SetHeight(in value: int) + + - SetWidth(in value: int) - - + SetWidth(in value: int) + + - SignatureDimension(in width: int, in height: int) +NRqxaR4mAAA9Kky9Yo8mswAAAABJRU5ErkJggg==" style="clip-path:url(#clipPath29); fill:rgb(0,127,0); stroke:rgb(0,127,0);" height="16" preserveAspectRatio="none" /> + SignatureDimension(in width: int, in height: int) - - SignatureDimension - - - - - - - - + SignatureDimension + + + + + + + + + + + + + + GetPage(): int + + + GetX(): int + + + GetY(): int + + + SetPage(in value: int) + + + SetX(in value: int) + + + SetY(in value: int) + + + SignaturePosition(in x: int, in y: int) + + + SignaturePosition(in x: int, in y: int, in page: int) + + + SignaturePosition() + + + - DocumentSource - - - - - - - - + SignaturePosition + + + + + + + + - CollimatingMark - - - - - - - - - +2Xri8wlLCDAAAAAASUVORK5CYII=" style="clip-path:url(#clipPath43);" height="16" preserveAspectRatio="none" /> + CollimatingMark + + + + + + + + + - - + + GetCollimatingMark(): CollimatingMark + + - GetSignaturePosition(): SignaturePosition - - + GetInputDocument(): DocumentSource + + + GetKeyIdentifier(): String + + + GetPlaceholderDimension(): SignatureDimension + + - GetSignedDocument(): DocumentSource - - GetSignaturePosition(): SignaturePosition + + - GetSignerCertificate(): Certificate + SetCollimatingMark(in value: CollimatingMark) + + + SetInputDocument(in value: DocumentSource) + + + SetKeyIdentifier(in value: String) + + + SetSignaturePosition(in signaturePosition: SignaturePosition) - - SignResult - «interface» - - - - - - - - - SLRequest - - - - - - - - + SignatureParameter + + + + + + + + - SLResponse - - - - «Import» - - - «Import» - - - «Import» - - - «Import» - - - - - # signaturePosition - 1 - - - - - - «Import» - - - «Import» - - - «Import» - - - «Import» - - - - - # collimark - 0..1 - - - - # documentSource - 1 - - - - - - «Import» - - - «Import» - - - «Import» - - - «Import» - + DocumentSource + + # signaturePosition + 1 + + + + # collimark + 0..1 + + + + # documentSource + 1 + + -- cgit v1.2.3