From dd45e938564249a5e6897bd92dd29808d8990868 Mon Sep 17 00:00:00 2001 From: rudolf Date: Fri, 24 Oct 2003 08:34:56 +0000 Subject: MOA-ID version 1.1 (initial) git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@19 d688527b-c9ab-4aba-bd8d-4036d912da1d --- .../AuthenticationBlockAssertionBuilder.java | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilder.java (limited to 'id.server/src/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilder.java') diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilder.java b/id.server/src/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilder.java new file mode 100644 index 000000000..4babf948c --- /dev/null +++ b/id.server/src/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilder.java @@ -0,0 +1,56 @@ +package at.gv.egovernment.moa.id.auth.builder; + +import java.text.MessageFormat; + +import at.gv.egovernment.moa.util.Constants; + +/** + * Builder for the authentication block <saml:Assertion> + * to be included in a <CreateXMLSignatureResponse>. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class AuthenticationBlockAssertionBuilder implements Constants { + /** private static String nl contains the NewLine representation in Java*/ + private static String nl = "\n"; + /** private static String AUTH_BLOCK contains an XML-Auth-Block-Template */ + private static String AUTH_BLOCK = + "" + nl + + " " + nl + + " " + nl + + " {2}" + nl + + " " + nl + + " " + nl + + " {3}" + nl + + " " + nl + + " " + nl + + " {4}" + nl + + " " + nl + + " " + nl + + ""; + + /** + * Constructor for AuthenticationBlockAssertionBuilder. + */ + public AuthenticationBlockAssertionBuilder() { + super(); + } + /** + * Builds the authentication block <saml:Assertion>. + * + * @param issuer authentication block issuer; "GivenName FamilyName" + * @param issueInstant current timestamp + * @param authURL URL of MOA-ID authentication component + * @param target "Geschäftsbereich" + * @param oaURL public URL of online application requested + * @return String representation of authentication block + * <saml:Assertion> built + */ + public String build(String issuer, String issueInstant, String authURL, String target, String oaURL) { + String assertion = MessageFormat.format( + AUTH_BLOCK, new Object[] { issuer, issueInstant, authURL, target, oaURL }); + return assertion; + } + +} -- cgit v1.2.3