diff options
author | gregor <gregor@d688527b-c9ab-4aba-bd8d-4036d912da1d> | 2005-07-26 14:43:17 +0000 |
---|---|---|
committer | gregor <gregor@d688527b-c9ab-4aba-bd8d-4036d912da1d> | 2005-07-26 14:43:17 +0000 |
commit | 36df570f6c24d60498bb8c040ffbaa4ad0f7583f (patch) | |
tree | 88b72a0f804dab0395768df814997bc777fd64ea /spss.server/src/at/gv/egovernment/moa/spss/api/impl | |
parent | 39ffc6c32b8c4c28e00f9b72a61542a40fb93946 (diff) | |
download | moa-id-spss-36df570f6c24d60498bb8c040ffbaa4ad0f7583f.tar.gz moa-id-spss-36df570f6c24d60498bb8c040ffbaa4ad0f7583f.tar.bz2 moa-id-spss-36df570f6c24d60498bb8c040ffbaa4ad0f7583f.zip |
Lösung für Bug 232 implementiert. Noch nicht final getestet.
git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@406 d688527b-c9ab-4aba-bd8d-4036d912da1d
Diffstat (limited to 'spss.server/src/at/gv/egovernment/moa/spss/api/impl')
3 files changed, 207 insertions, 2 deletions
diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/InputDataBinaryImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/InputDataBinaryImpl.java new file mode 100644 index 000000000..42d61559e --- /dev/null +++ b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/InputDataBinaryImpl.java @@ -0,0 +1,99 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import java.io.InputStream; + +import at.gv.egovernment.moa.spss.MOARuntimeException; +import at.gv.egovernment.moa.spss.api.common.Content; +import at.gv.egovernment.moa.spss.api.common.ContentBinary; +import at.gv.egovernment.moa.spss.api.common.InputData; + +/** + * Content wrapper decorating a binary content with two additional attributes + * needed for returning <code>HashInputData</code> and <code>ReferenceInputData + * </code> information as part of <code>VerifyXMLSignatureResponse</code>. + * + * @author Gregor Karlinger + * + * @version $Id$ + */ +public class InputDataBinaryImpl implements ContentBinary, InputData +{ + /** + * The wrapped <code>Content</code>. + */ + protected ContentBinary wrapped_; + + /** + * This attribute signals what kind of container the XMLDSIG <code>Reference</code> + * this <code>InputData</code> belongs to is part of. + */ + protected String partOf_; + + /** + * If this <code>InputData</code> belongs to an XMLDSIG <code>Reference</code> + * being part of either a XMLDSIGManifest or a SignatureManifest, this attribute + * (a positive int) signals the particular <code>Reference</code> of the XMLDSIG + * <code>SignedInfo</code> referring to the XMLDSIGManifest or SignatureManifest + * respectively. + */ + protected int referringReferenceNumber_; + + /** + * Creates a new instance. + * + * @param wrapped The wrapped <code>Content</code>. Must be of type {@link Content#BINARY_CONTENT}. + * + * @param partOf see {@link InputData} + * + * @param referringReferenceNumber see {@link InputData} + */ + public InputDataBinaryImpl(Content wrapped, String partOf, int referringReferenceNumber) throws MOARuntimeException + { + if (wrapped.getContentType() != Content.BINARY_CONTENT) throw new MOARuntimeException("9901", null); + + wrapped_ = (ContentBinary) wrapped; + partOf_ = partOf; + referringReferenceNumber_ = referringReferenceNumber; + } + + /** + * @see at.gv.egovernment.moa.spss.api.common.Content#getContentType() + */ + public int getContentType() + { + return wrapped_.getContentType(); + } + + /** + * @see at.gv.egovernment.moa.spss.api.common.Content#getReference() + */ + public String getReference() + { + return wrapped_.getReference(); + } + + /** + * @see at.gv.egovernment.moa.spss.api.common.ContentBinary#getBinaryContent() + */ + public InputStream getBinaryContent() + { + return wrapped_.getBinaryContent(); + } + + /** + * @see at.gv.egovernment.moa.spss.api.common.InputData#getPartOf() + */ + public String getPartOf() + { + return partOf_; + } + + /** + * @see at.gv.egovernment.moa.spss.api.common.InputData#getReferringReferenceNumber() + */ + public int getReferringReferenceNumber() + { + return referringReferenceNumber_; + } + +} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/InputDataXMLImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/InputDataXMLImpl.java new file mode 100644 index 000000000..029a402f5 --- /dev/null +++ b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/InputDataXMLImpl.java @@ -0,0 +1,99 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import org.w3c.dom.NodeList; + +import at.gv.egovernment.moa.spss.MOARuntimeException; +import at.gv.egovernment.moa.spss.api.common.Content; +import at.gv.egovernment.moa.spss.api.common.ContentXML; +import at.gv.egovernment.moa.spss.api.common.InputData; + +/** + * Content wrapper decorating an XML content with two additional attributes + * needed for returning <code>HashInputData</code> and <code>ReferenceInputData + * </code> information as part of <code>VerifyXMLSignatureResponse</code>. + * + * @author Gregor Karlinger + * + * @version $Id$ + */ +public class InputDataXMLImpl implements ContentXML, InputData +{ + /** + * The wrapped <code>ContentXML</code>. + */ + protected ContentXML wrapped_; + + /** + * This attribute signals what kind of container the XMLDSIG <code>Reference</code> + * this <code>InputData</code> belongs to is part of. + */ + protected String partOf_; + + /** + * If this <code>InputData</code> belongs to an XMLDSIG <code>Reference</code> + * being part of either a XMLDSIGManifest or a SignatureManifest, this attribute + * (a positive int) signals the particular <code>Reference</code> of the XMLDSIG + * <code>SignedInfo</code> referring to the XMLDSIGManifest or SignatureManifest + * respectively. + */ + protected int referringReferenceNumber_; + + /** + * Creates a new instance. + * + * @param wrapped The wrapped <code>ContentBinary</code>. Must be of type {@link Content#XML_CONTENT}. + * + * @param partOf see {@link InputData} + * + * @param referringReferenceNumber see {@link InputData} + */ + public InputDataXMLImpl(Content wrapped, String partOf, int referringReferenceNumber) + { + if (wrapped.getContentType() != Content.XML_CONTENT) throw new MOARuntimeException("9901", null); + + wrapped_ = (ContentXML) wrapped; + partOf_ = partOf; + referringReferenceNumber_ = referringReferenceNumber; + } + + /** + * @see at.gv.egovernment.moa.spss.api.common.Content#getContentType() + */ + public int getContentType() + { + return wrapped_.getContentType(); + } + + /** + * @see at.gv.egovernment.moa.spss.api.common.Content#getReference() + */ + public String getReference() + { + return wrapped_.getReference(); + } + + /** + * @see at.gv.egovernment.moa.spss.api.common.ContentXML#getXMLContent() + */ + public NodeList getXMLContent() + { + return wrapped_.getXMLContent(); + } + + /** + * @see at.gv.egovernment.moa.spss.api.common.InputData#getPartOf() + */ + public String getPartOf() + { + return partOf_; + } + + /** + * @see at.gv.egovernment.moa.spss.api.common.InputData#getReferringReferenceNumber() + */ + public int getReferringReferenceNumber() + { + return referringReferenceNumber_; + } + +} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureResponseImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureResponseImpl.java index f163013c1..989dbfb4a 100644 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureResponseImpl.java +++ b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureResponseImpl.java @@ -18,10 +18,17 @@ public class VerifyXMLSignatureResponseImpl /** Information about the signer certificate. */ private SignerInfo signerInfo; - /** The hash input data objects. */ + + /** + * The hash input data objects. The list consists of {@link at.gv.egovernment.moa.spss.api.common.InputData}s. + * */ private List hashInputDatas = new ArrayList(); - /** The reference input data objects. */ + + /** + * The reference input data objects. The list consists of {@link at.gv.egovernment.moa.spss.api.common.InputData}s. + * */ private List referenceInputDatas = new ArrayList(); + /** Information about the signature check. */ private ReferencesCheckResult signatureCheck; /** Information about the signature manifest check. */ |