From b9e7df0cbe67b486ce3a1a2177bd08c0ced9e005 Mon Sep 17 00:00:00 2001
From: "(no author)" <(no author)@d688527b-c9ab-4aba-bd8d-4036d912da1d>
Date: Mon, 22 Dec 2003 17:51:40 +0000
Subject: This commit was manufactured by cvs2svn to create tag 'Build_002'.
git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/tags/Build_002@88 d688527b-c9ab-4aba-bd8d-4036d912da1d
---
.../AuthenticationDataAssertionBuilder.java | 114 ---------------------
1 file changed, 114 deletions(-)
delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/builder/AuthenticationDataAssertionBuilder.java
(limited to 'id.server/src/at/gv/egovernment/moa/id/auth/builder/AuthenticationDataAssertionBuilder.java')
diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/builder/AuthenticationDataAssertionBuilder.java b/id.server/src/at/gv/egovernment/moa/id/auth/builder/AuthenticationDataAssertionBuilder.java
deleted file mode 100644
index fd7cb1a9d..000000000
--- a/id.server/src/at/gv/egovernment/moa/id/auth/builder/AuthenticationDataAssertionBuilder.java
+++ /dev/null
@@ -1,114 +0,0 @@
-package at.gv.egovernment.moa.id.auth.builder;
-
-import java.text.MessageFormat;
-
-import at.gv.egovernment.moa.id.BuildException;
-import at.gv.egovernment.moa.id.data.AuthenticationData;
-import at.gv.egovernment.moa.util.Constants;
-
-/**
- * Builder for the authentication data <saml:Assertion>
- * to be provided by the MOA ID Auth component.
- *
- * @author Paul Ivancsics
- * @version $Id$
- */
-public class AuthenticationDataAssertionBuilder implements Constants {
- /** private static String NL contains the NewLine representation in Java*/
- private static final String NL = "\n";
- /**
- * XML template for the <saml:Assertion>
to be built
- */
- private static final String AUTH_DATA =
- "" + NL +
- "" + NL +
- " " + NL +
- " " + NL +
- " {3}" + NL +
- " " + NL +
- " " + MOA_NS_URI + "cm" + NL +
- " {4}{5}" + NL +
- " " + NL +
- " " + NL +
- " " + NL +
- " {6}" + NL +
- " " + NL +
- " " + NL +
- " {7}" + NL +
- " " + NL +
- "{8}" +
- " " + NL +
- "";
- /**
- * XML template for the <saml:Attribute>
named "isPublicAuthority"
,
- * to be inserted into the <saml:Assertion>
- */
- private static final String PUBLIC_AUTHORITY_ATT =
- " " + NL +
- " {0}" + NL +
- " " + NL;
-
- /**
- * Constructor for AuthenticationDataAssertionBuilder.
- */
- public AuthenticationDataAssertionBuilder() {
- super();
- }
-
- /**
- * Builds the authentication data <saml:Assertion>
.
- *
- * @param authData the AuthenticationData
to build the
- * <saml:Assertion>
from
- * @param xmlPersonData lt;pr:Person>
element as a String
- * @param xmlAuthBlock authentication block to be included in a
- * lt;saml:SubjectConfirmationData>
element; may include
- * the "ZMR-Zahl"
or not; may be empty
- * @param xmlIdentityLink the IdentityLink
- * @return the <saml:Assertion>
- * @throws BuildException if an error occurs during the build process
- */
- public String build(
- AuthenticationData authData,
- String xmlPersonData,
- String xmlAuthBlock,
- String xmlIdentityLink) throws BuildException {
-
- String isQualifiedCertificate = authData.isQualifiedCertificate() ? "true" : "false";
- String publicAuthorityAttribute = "";
- if (authData.isPublicAuthority()) {
- String publicAuthorityIdentification = authData.getPublicAuthorityCode();
- if (publicAuthorityIdentification == null)
- publicAuthorityIdentification = "True";
- publicAuthorityAttribute = MessageFormat.format(
- PUBLIC_AUTHORITY_ATT, new Object[] { publicAuthorityIdentification });
- }
-
- String assertion = MessageFormat.format(AUTH_DATA, new Object[] {
- authData.getAssertionID(),
- authData.getIssuer(),
- authData.getIssueInstant(),
- authData.getVPK(),
- removeXMLDeclaration(xmlAuthBlock),
- removeXMLDeclaration(xmlIdentityLink),
- removeXMLDeclaration(xmlPersonData),
- isQualifiedCertificate,
- publicAuthorityAttribute});
- return assertion;
- }
-
- /**
- * Removes the XML declaration from an XML expression.
- * @param xmlString XML expression as String
- * @return XML expression, XML declaration removed
- */
- private String removeXMLDeclaration(String xmlString) {
- if (xmlString.startsWith("