Skip to content
Permalink
Browse files

began localizing enroll

  • Loading branch information...
cyberphone committed Oct 24, 2018
1 parent d91607a commit 1bfdce42ee02c8271115b8faca7e2eb5b79489f5
@@ -1,2 +1,4 @@
/e-government.*
/enroll.*


@@ -13,7 +13,7 @@ DEMO_EMAIL_PROVIDER = orange.fr

# App UI emulator only
UI_DEMO_TOP_URL = impots.gouv.fr
UI_DEMO_AUTH_TO = Ce Connecter au Service
UI_DEMO_AUTH_TO = Connectez-vous au Service
UI_DEMO_SELECTED_CRED = Justificatif d'Identité
UI_DEMO_HT_REQUEST_DOMAIN = Le domaine demandant

@@ -100,10 +100,12 @@ void demoAuthentication(HttpServletRequest request, HttpServletResponse response
"<tr><td>")
.append(eGovernmentService.demoCard)
.append("</td></tr>" +
"<tr><td>")
"<tr><td><div style=\"display:flex;justify-content:center\"><div>PIN</div><div>Field</div><div>PIN</div>" +
"</div></td></tr>" +
"<tr><td>")
.append(eGovernmentService.pinKeyboard)
.append("</td></tr>" +
"</table>");
"</table>");
HTML.resultPage(response, null, html);
}
}
@@ -167,7 +167,7 @@ public void contextInitialized(ServletContextEvent sce) {
.replace("@i", userData.getUserIdHTMLString());

StringBuilder svg = new StringBuilder(
"<svg style=\"height:100pt;padding:4pt 10pt 20pt 10pt\" viewBox=\"0 0 318 190\" xmlns=\"http://www.w3.org/2000/svg\">\n" +
"<svg style=\"height:100pt;display:block;margin-left:auto;margin-right:auto\" viewBox=\"0 0 318 190\" xmlns=\"http://www.w3.org/2000/svg\">\n" +
"<defs>\n" +
" <clipPath id=\"cardClip\">\n" +
" <rect rx=\"15\" ry=\"15\" height=\"180\" width=\"300\" y=\"0\" x=\"0\"/>\n" +
@@ -206,14 +206,14 @@ public void contextInitialized(ServletContextEvent sce) {

svg.delete(0, demoCard.indexOf('>'))
.insert(0,
"<svg width=\"418\" height=\"290\" xmlns=\"http://www.w3.org/2000/svg\">\n" +
"<svg width=\"418\" height=\"288\" xmlns=\"http://www.w3.org/2000/svg\">\n" +
"<title>Mobile ID - Virtual Card Credential</title>\n" +
"<svg x=\"50\" y=\"50\"")
.append("</svg>\n");
logger.info(svg.toString());

String kbd = getResourceString("pinkeyboard.svg");
pinKeyboard = "<svg style=\"width:200pt;padding:5pt\" " +
pinKeyboard = "<svg style=\"display:block;width:200pt;padding:0 5pt 5pt 5pt\" " +
kbd.substring(kbd.indexOf("svg "));
}

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="localized"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="C:/github.repositories/saturn/resources/ref.lib/servlet-api.jar"/>
<classpathentry kind="lib" path="C:/github.repositories/saturn/resources/common.lib/bcprov-jdk15on-151.jar"/>
@@ -1,2 +1,3 @@
eclipse.preferences.version=1
encoding//localization/fr/fr.properties=UTF-8
encoding/<project>=UTF-8
@@ -1,11 +1,13 @@
<project name="MobileID (Demo) Key Provider" default="help" basedir=".">

<!-- set properties for this build -->
<property file="../resources/common.properties"/>
<property name="resource.dir" location="../resources"/>
<property file="${resource.dir}/common.properties"/>
<basename property="tls_cert_file" file="${tls_cert_path}"/>
<property name="logging" value="false"/>

<property name="src.dir" value="src"/>
<property name="localized.dir" value="localized"/>
<property name="temp.dir" value=".tmp"/>
<property name="class_war_path" value="WEB-INF/classes/org/webpki/mobileid/keyprovider"/>

@@ -22,7 +24,7 @@
<property name="catalina.home" value="${env.CATALINA_HOME}"/>

<target name="help">
<echo message="tomcat"/>
<echo message="tomcat [-Dlogging=true]"/>
</target>

<target name="_init" unless="app_path">
@@ -37,19 +39,22 @@
</target>

<target name="tomcat" depends="_init">
<property name="zip.common.lib.dir" value="${common.lib.dir}"/>
<property name="zip.bcprovider.lib.dir" value="${bcprovider.lib.dir}"/>
<delete dir="${temp.dir}"/>
<fixcrlf srcdir="${src.dir}"
tab="remove"
tablength="4"
eol="lf"
eof="remove"
includes="**/*.java"/>
includes="**/*.java, **/*.css, **/*.xml, **/*.properties"/>
<copy file="web.xml" todir="${temp.dir}"/>
<javac debug="${debug}"
source="${javaversion}"
target="${javaversion}"
srcdir="${src.dir}"
srcdir="${src.dir}:${localized.dir}"
destdir="${temp.dir}"
encoding="UTF-8"
includeAntRuntime="false">
<classpath>
<fileset dir="${common.lib.dir}">
@@ -78,24 +83,24 @@
<classes dir="${temp.dir}">
<exclude name="web.xml"/>
</classes>
<lib dir="${common.lib.dir}">
<lib dir="${zip.common.lib.dir}">
<include name="${webpki-libext.jar}"/>
</lib>
<lib dir="${common.lib.dir}">
<lib dir="${zip.common.lib.dir}">
<include name="${webpki-webutil.jar}"/>
</lib>
<lib dir="${bcprovider.lib.dir}">
<lib dir="${zip.bcprovider.lib.dir}">
<include name="${bcprovider.jar}"/>
</lib>
<zipfileset dir="${key.dir}" prefix="${class_war_path}">
<zipfileset dir="${cakey.dir}" prefix="${class_war_path}">
<include name="*-sub-ca.p12"/>
<include name="*-kmk.p12"/>
</zipfileset>
<zipfileset dir="${logotype.dir}" prefix="${class_war_path}">
<include name="card-*"/>
<include name="*-card.svg"/>
</zipfileset>
<zipfileset file="${logotype.dir}/mobileidlogo.svg" prefix="images"/>
<zipfileset file="../resources/issuers.json" prefix="${class_war_path}"/>
<zipfileset file="${resource.dir}/issuers.json" prefix="${class_war_path}"/>
<zipfileset file="${tls_cert_path}" prefix="${class_war_path}"/>
<fileset dir="web"/>
</war>
@@ -0,0 +1,15 @@
# Properties holding french lines for the e-government application

LANGUAGE_CODE = fr

TITLE = Mobile ID/Gouvernement Numérique
URL_TO_DESCRIPTION = https://cyberphone.github.io/doc/mobile-id/fr

# Description
DESCRIPTION = C'est un truc fantastic, pour le @ system

# Button text
START_ENROLLMENT = Demaree Enrollment

# Limitations
ANDROID_ONLY = Seulment Android
@@ -0,0 +1,16 @@
<project name="Make a French version of the source" default="help" basedir=".">

<!-- set french specialtes -->

<target name="help">
<echo message="help localize"/>
</target>

<target name="localize">
<replace file="${app.dir}/build.xml" failOnNoReplacements="true">
<replacetoken expandProperties="false"><![CDATA[${application.path}]]></replacetoken>
<replacevalue><![CDATA[mobileid.fr#]]></replacevalue>
</replace>
</target>

</project>
@@ -0,0 +1,38 @@
/*
* Copyright 2015-2018 WebPKI.org (http://webpki.org).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package org.webpki.localized;

public interface LocalizedStrings {

String LANGUAGE_CODE = "en";

String TITLE = "Mobile ID Enrollment Demo";
String URL_TO_DESCRIPTION = "http://cyberphone.github.io/doc/mobile-id";

// Description
String DESCRIPTION = "This is a proof of concept site " +
"hosting an enrollment application " +
"for the @ system";

// Button text
String START_ENROLLMENT = "Start Enrollment";

// Limitations
String ANDROID_ONLY = "This demo currently only supports Android";
}

This file was deleted.

@@ -32,6 +32,8 @@

import org.webpki.keygen2.ServerState;

import org.webpki.localized.LocalizedStrings;

import org.webpki.util.Base64URL;

import org.webpki.webutil.ServletUtil;
@@ -117,7 +119,8 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) thro
getHTML(null,
null,
"<tr><td width=\"100%\" align=\"center\" valign=\"middle\">" +
"This proof-of-concept system only supports Android</td></tr>"));
LocalizedStrings.ANDROID_ONLY +
"</td></tr>"));
return;
}
if (keygen2EnrollmentUrl == null) {
@@ -152,6 +155,8 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) thro
"<tr><td align=\"center\">" +
"<a href=\"intent://keygen2?" + extra +
"#Intent;scheme=webpkiproxy;" +
"package=org.webpki.mobile.android;end\">Start KeyGen2</a></td></tr></table></td></tr>"));
"package=org.webpki.mobile.android;end\">" +
LocalizedStrings.START_ENROLLMENT +
"</a></td></tr></table></td></tr>"));
}
}
@@ -85,7 +85,7 @@ public IssuerHolder(JSONObjectReader issuerObject) throws IOException {
getPropertyString(KEYSTORE_PASSWORD));
subCA = new KeyStoreEnumerator(getResource(issuerBase + "-sub-ca.p12"),
getPropertyString(KEYSTORE_PASSWORD));
cardImage = getResourceString("card-" + issuerBase + ".svg");
cardImage = getResourceString(issuerBase + "-card.svg");
issuerObject.checkForUnread();
}
}
@@ -17,7 +17,7 @@
</path>

<target name="help">
<echo message="localize -Dapp-sub-dir=e-government -Dlocale=fr [-Dlocalized.egov-app.dir=adirectory -Ddemo=true -Dlogging=true]]"/>
<echo message="localize -Dapp-sub-dir=e-government -Dlocale=fr [-Dlocalized.egov-app.dir=adirectory -Duidemo=true -Dlogging=true]]"/>
</target>

<target name="localize">

0 comments on commit 1bfdce4

Please sign in to comment.
You can’t perform that action at this time.