diff options
author | (no author) <(no author)@d688527b-c9ab-4aba-bd8d-4036d912da1d> | 2005-01-28 14:10:50 +0000 |
---|---|---|
committer | (no author) <(no author)@d688527b-c9ab-4aba-bd8d-4036d912da1d> | 2005-01-28 14:10:50 +0000 |
commit | 7916c117627db0411b35f202f88b2ab6e115361a (patch) | |
tree | 64d196008935d0c2913958edca0c4a8da62eec2f /spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureResponseBuilder.java | |
parent | d9183e34404ab3431c94002b963985a4346cf60a (diff) | |
download | moa-id-spss-7916c117627db0411b35f202f88b2ab6e115361a.tar.gz moa-id-spss-7916c117627db0411b35f202f88b2ab6e115361a.tar.bz2 moa-id-spss-7916c117627db0411b35f202f88b2ab6e115361a.zip |
This commit was manufactured by cvs2svn to create tagtags/MOA-ID-1_20d09
'MOA-ID-1_20d09'.
git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/tags/MOA-ID-1_20d09@264 d688527b-c9ab-4aba-bd8d-4036d912da1d
Diffstat (limited to 'spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureResponseBuilder.java')
-rw-r--r-- | spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureResponseBuilder.java | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureResponseBuilder.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureResponseBuilder.java deleted file mode 100644 index 3fc8f223d..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureResponseBuilder.java +++ /dev/null @@ -1,101 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlbind; - -import java.util.Iterator; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.MOASystemException; -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponse; -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponseElement; -import at.gv.egovernment.moa.spss.api.common.CheckResult; -import at.gv.egovernment.moa.spss.api.common.SignerInfo; - -/** - * Convert a <code>VerifyCMSSignatureResponse</code> API object into its - * XML representation, according to the MOA XML schema. - * - * @author Patrick Peck - * @version $Id$ - */ -public class VerifyCMSSignatureResponseBuilder { - /** The XML document containing the response element. */ - private Document responseDoc; - /** The response <code>VerifyCMSSignatureResponse</code> DOM element. */ - private Element responseElem; - - /** - * Create a new <code>VerifyCMSSignatureResponseBuilder</code>: - * - * @throws MOASystemException An error occurred setting up the resulting - * XML document. - */ - public VerifyCMSSignatureResponseBuilder() throws MOASystemException { - responseDoc = - ResponseBuilderUtils.createResponse("VerifyCMSSignatureResponse"); - responseElem = responseDoc.getDocumentElement(); - } - - /** - * Build a document containing a <code>VerifyCMSSignatureResponse</code> - * DOM element being the XML representation of the given - * <code>VerifyCMSSignatureResponse</code> API object. - * - * @param response The <code>VerifyCMSSignatureResponse</code> to convert - * to XML. - * @return A document containing the <code>VerifyCMSSignatureResponse</code> - * DOM element. - * @throws MOAApplicationException An error occurred building the response. - */ - public Document build(VerifyCMSSignatureResponse response) - throws MOAApplicationException { - - Iterator iter; - - for (iter = response.getResponseElements().iterator(); iter.hasNext();) { - VerifyCMSSignatureResponseElement responseElement = - (VerifyCMSSignatureResponseElement) iter.next(); - addResponseElement(responseElement); - } - - return responseDoc; - } - - /** - * Add an element to the response. - * - * @param responseElement The element to add to the response. - * @throws MOAApplicationException An error occurred adding the element. - */ - private void addResponseElement(VerifyCMSSignatureResponseElement responseElement) - throws MOAApplicationException { - - SignerInfo signerInfo = responseElement.getSignerInfo(); - CheckResult signatureCheck = responseElement.getSignatureCheck(); - CheckResult certCheck = responseElement.getCertificateCheck(); - - ResponseBuilderUtils.addSignerInfo( - responseDoc, - responseElem, - signerInfo.getSignerCertificate(), - signerInfo.isQualifiedCertificate(), - signerInfo.isPublicAuthority(), - signerInfo.getPublicAuhtorityID()); - - ResponseBuilderUtils.addCodeInfoElement( - responseDoc, - responseElem, - "SignatureCheck", - signatureCheck.getCode(), - signatureCheck.getInfo()); - - ResponseBuilderUtils.addCodeInfoElement( - responseDoc, - responseElem, - "CertificateCheck", - certCheck.getCode(), - certCheck.getInfo()); - } - -} |