diff options
author | Tobias Kellner <tobias.kellner@iaik.tugraz.at> | 2014-11-27 20:48:16 +0100 |
---|---|---|
committer | Tobias Kellner <tobias.kellner@iaik.tugraz.at> | 2014-11-27 20:48:16 +0100 |
commit | 896fbe4a5643bf8c29968f8514a1c14fd51c4d9e (patch) | |
tree | 0f3e3bec7093e9be39c94199b50db1a61154c54d /pdf-over-signer/pdf-over-sigpdfas4/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SigningState.java | |
parent | 5ef48a2002856bea0cac10e1dac6fb2985dca893 (diff) | |
download | mocca-896fbe4a5643bf8c29968f8514a1c14fd51c4d9e.tar.gz mocca-896fbe4a5643bf8c29968f8514a1c14fd51c4d9e.tar.bz2 mocca-896fbe4a5643bf8c29968f8514a1c14fd51c4d9e.zip |
Add PDF-AS4 signer
Diffstat (limited to 'pdf-over-signer/pdf-over-sigpdfas4/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SigningState.java')
-rw-r--r-- | pdf-over-signer/pdf-over-sigpdfas4/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SigningState.java | 133 |
1 files changed, 133 insertions, 0 deletions
diff --git a/pdf-over-signer/pdf-over-sigpdfas4/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SigningState.java b/pdf-over-signer/pdf-over-sigpdfas4/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SigningState.java new file mode 100644 index 00000000..b8280142 --- /dev/null +++ b/pdf-over-signer/pdf-over-sigpdfas4/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SigningState.java @@ -0,0 +1,133 @@ +/* + * Copyright 2012 by A-SIT, Secure Information Technology Center Austria + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://joinup.ec.europa.eu/software/page/eupl + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + */ +package at.asit.pdfover.signer.pdfas; + +//Imports +import java.io.ByteArrayOutputStream; + +import at.asit.pdfover.signator.BkuSlConnector; +import at.asit.pdfover.signator.SLRequest; +import at.asit.pdfover.signator.SLResponse; +import at.asit.pdfover.signator.SigningState; +import at.gv.egiz.pdfas.lib.api.sign.SignParameter; + +/** + * Signing State for PDFAS Wrapper + */ +public class PdfAs4SigningState implements SigningState { + + /** + * The Signature Layer request + */ + private SLRequest slrequest; + + /** + * The Signature Layer response + */ + private SLResponse slresponse; + + /** + * The Sign Parameters + */ + private SignParameter parameter; + + private ByteArrayOutputStream output; + + private BkuSlConnector connector; + + /* (non-Javadoc) + * @see at.asit.pdfover.signator.SigningState#getSignatureRequest() + */ + @Override + public SLRequest getSignatureRequest() { + return this.slrequest; + } + + /* (non-Javadoc) + * @see at.asit.pdfover.signator.SigningState#setSignatureResponse(at.asit.pdfover.signator.SLResponse) + */ + @Override + public void setSignatureResponse(SLResponse response) { + this.slresponse = response; + } + + /** + * Sets the SL Request + * @param request The SL Request + */ + public void setSignatureRequest(SLRequest request) { + this.slrequest = request; + } + + /** + * Gets the SL Response + * @return The SL Response object + */ + public SLResponse getSignatureResponse() { + return this.slresponse; + } + + /* (non-Javadoc) + * @see at.asit.pdfover.signator.SigningState#hasSignatureResponse() + */ + @Override + public boolean hasSignatureResponse() { + return this.slresponse != null; + } + + /** + * @return the output + */ + public ByteArrayOutputStream getOutput() { + return this.output; + } + + /** + * @param output the output to set + */ + public void setOutput(ByteArrayOutputStream output) { + this.output = output; + } + + /** + * @return the parameter + */ + public SignParameter getSignParameter() { + return this.parameter; + } + + /** + * @param parameter the parameter to set + */ + public void setSignParameter(SignParameter parameter) { + this.parameter = parameter; + } + + /* (non-Javadoc) + * @see at.asit.pdfover.signator.SigningState#setBKUConnector(at.asit.pdfover.signator.BkuSlConnector) + */ + @Override + public void setBKUConnector(BkuSlConnector connector) { + this.connector = connector; + } + + /** + * @return the connector + */ + public BkuSlConnector getBKUConnector() { + return this.connector; + } +} |