Repository navigation
Expand file tree
/
Copy pathbuild.xml
More file actions
228 lines (208 loc) · 7.88 KB
/
Copy pathbuild.xml
File metadata and controls
228 lines (208 loc) · 7.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
<project name="FIDO Web Pay (FWP) Demo" default="help">
<!-- set properties for this build -->
<property file="fwp.properties"/>
<property name="openkeystore.dir" location="${openkeystore}"/>
<property name="fido-web-pay.dir" location="${fido-web-pay}"/>
<property name="current.dir" location="."/>
<property name="src.dir" value="src"/>
<property name="test.dir" value="test"/>
<property name="lib.dir" value="lib"/>
<property name="temp.dir" value=".tmp"/>
<property name="dist.dir" value="dist"/>
<property name="testdata.dir" location="testdata"/>
<property name="class_war_path" value="WEB-INF/classes/org/webpki/webapps/fwp"/>
<property name="webroot" value="webapps"/>
<property name="logging" value="false"/>
<property name="appcorename" value="fwp"/>
<property name="application" value="${appcorename}.war"/>
<property name="keypassword" value="foo123"/>
<property name="webpki.lib.dir" value="${openkeystore.dir}/library/dist"/>
<condition property="zip.webpki.lib.dir" value="${webpki.lib.dir}" else="empty.lib">
<isset property="include.webpki.in.war"/>
</condition>
<property name="third.party.lib.dir" location="${openkeystore.dir}/resources/third-party-jars"/>
<property name="debug" value="on"/>
<property name="javaversion" value="${ant.java.version}"/>
<condition property="tested.version" else="false">
<equals arg1="21" arg2="${javaversion}"/>
</condition>
<target name="_jdktest" unless="${tested.version}">
<echo message="
***************************************************************
WARNING - This package has only been tested with Java 21!
*************************************************************** "/>
</target>
<property environment="env"/>
<condition property="catalina.home" value="${env.CATALINA_HOME}">
<isset property="env.CATALINA_HOME"/>
</condition>
<target name="help">
<echo message="build tomcat testfido cryptosvg cryptodoc vectors crypto-alternative ctap2test -Ddata2sign=b64u -Dsignature=b64u -Dauthenticatordata=b64u"/>
</target>
<target name="tomcat">
<fail message="CATALINA_HOME must be set to environment!" unless="catalina.home"/>
<antcall target="build"/>
<copy file="${dist.dir}/${application}" todir="${catalina.home}/${webroot}" overwrite="true" preservelastmodified="true"/>
</target>
<target name="_compile">
<antcall target="_jdktest"/>
<mkdir dir="${dist.dir}"/>
<delete dir="${temp.dir}"/>
<mkdir dir="${temp.dir}"/>
<fixcrlf srcdir="."
tab="remove"
tablength="4"
eol="lf"
eof="remove"
includes="**/*.java, **/*.css, **/*.svg, **/*.xml, **/*.html"/>
<javac debug="${debug}"
srcdir="${src.dir};${lib.dir}:${test.dir}"
destdir="${temp.dir}"
includeAntRuntime="false">
<classpath>
<fileset dir="${webpki.lib.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir="${third.party.lib.dir}">
<include name="*.jar"/>
</fileset>
</classpath>
</javac>
</target>
<target name="build" depends="_compile">
<copy file="web.xml" todir="${temp.dir}"/>
<replace file="${temp.dir}/web.xml">
<replacefilter token="@logging@" value="${logging}"/>
</replace>
<war destfile="${dist.dir}/${application}" webxml="${temp.dir}/web.xml">
<classes dir="${temp.dir}">
<exclude name="web.xml"/>
</classes>
<metainf dir=".">
<include name="context.xml"/>
</metainf>
<lib dir="${zip.webpki.lib.dir}">
<include name="webpki.org-libext*.jar"/>
<include name="webpki.org-webutil*.jar"/>
</lib>
<fileset dir="web"/>
<zipfileset dir="${openkeystore.dir}/resources/images" prefix="images/">
<include name="thelab.svg"/>
</zipfileset>
<zipfileset dir="${openkeystore.dir}/testdata/keys" prefix="${class_war_path}">
<include name="x25519privatekey.jwk"/>
</zipfileset>
</war>
</target>
<target name="testfido" depends="_compile">
<property name="testvectors" location="${testdata.dir}/fido2testvectors.json"/>
<junit fork="no" haltonfailure="yes">
<test name="org.webpki.fwp.FIDOTest"/>
<formatter type="plain" usefile="false"/>
<sysproperty key="json.data" value="${testvectors}"/>
<sysproperty key="sample.keys" value="${openkeystore.dir}/testdata/keys"/>
<classpath>
<pathelement path="${temp.dir}"/>
<fileset dir="${webpki.lib.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir="${third.party.lib.dir}">
<include name="*.jar"/>
</fileset>
</classpath>
</junit>
</target>
<target name="cryptosvg" depends="_compile">
<java fork="yes"
classname="org.webpki.fwp.CryptoImages"
failonerror="true">
<classpath>
<pathelement path="${temp.dir}"/>
<fileset dir="${webpki.lib.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir="${third.party.lib.dir}">
<include name="*.jar"/>
</fileset>
</classpath>
<arg line="${current.dir}"/>
</java>
</target>
<target name="cryptodoc" depends="_compile">
<java fork="yes"
classname="org.webpki.fwp.CryptoDocument"
failonerror="true">
<classpath>
<pathelement path="${temp.dir}"/>
<fileset dir="${webpki.lib.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir="${third.party.lib.dir}">
<include name="*.jar"/>
</fileset>
</classpath>
<arg line="${current.dir} ${fido-web-pay.dir}/specification/crypto.html"/>
</java>
</target>
<target name="vectors" depends="_compile">
<java fork="yes"
classname="org.webpki.fwp.TestVectorGeneration"
failonerror="true">
<classpath>
<pathelement path="${temp.dir}"/>
<fileset dir="${webpki.lib.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir="${third.party.lib.dir}">
<include name="*.jar"/>
</fileset>
</classpath>
<arg line="${testdata.dir} ${openkeystore.dir}/testdata/keys"/>
</java>
<copy todir="${fido-web-pay.dir}/specification/originals" overWrite="true">
<fileset dir="${testdata.dir}">
<include name="AD.txt"/>
<include name="SAD.txt"/>
<include name="ESAD.txt"/>
<include name="FWP-assertion.json"/>
<include name="PSP-request.json"/>
<include name="ISSUER-request.json"/>
</fileset>
</copy>
</target>
<target name="crypto-alternative" depends="_compile">
<java fork="yes"
classname="org.webpki.fwp.CryptoAlternative"
failonerror="true">
<classpath>
<pathelement path="${temp.dir}"/>
<fileset dir="${webpki.lib.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir="${third.party.lib.dir}">
<include name="*.jar"/>
</fileset>
</classpath>
<arg line="${dist.dir} ${openkeystore.dir}/testdata/keys"/>
</java>
</target>
<target name="ctap2test" depends="_compile">
<property name="data2sign" value=""/>
<property name="signature" value=""/>
<property name="authenticatordata" value=""/>
<java fork="yes"
classname="org.webpki.fwp.Ctap2Test"
failonerror="true">
<classpath>
<pathelement path="${temp.dir}"/>
<fileset dir="${webpki.lib.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir="${third.party.lib.dir}">
<include name="*.jar"/>
</fileset>
</classpath>
<arg line="${data2sign} ${signature} ${authenticatordata}"/>
</java>
</target>
</project>