-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathcli.xml
549 lines (510 loc) · 28.5 KB
/
cli.xml
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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
<project name="cli" default="ejbca:install" basedir="." xmlns:ejbca="ejbca">
<fail unless="ejbca.home" message="This ant script cannot be run stand-alone.."/>
<!--
This is a transcript of the install.sh content to avoid platform specific problems
Hopefully this will simplify maintenance and deployment but it needs more work.
-->
<target name="check:bootstrapdone">
<available file="${ejbca.home}/dist/ejbca.ear" property="bootstrap.done"/>
<fail unless="bootstrap.done" message="Missing EJBCA_HOME/dist/ejbca.ear. You must do 'ant build' to build the ejbca.ear file." />
</target>
<!-- ======================================================================= -->
<!-- Promts for passwords required at deployment -->
<!-- Note: This code is duplicated in build.xml -->
<!-- ======================================================================= -->
<target name="ejbca:deploytrustprompt">
<input message="Please enter the password of the truststore with the CA certificate for https?" addproperty="java.trustpassword" defaultvalue="changeit">
<handler classname="org.apache.tools.ant.input.SecureInputHandler" />
</input>
</target>
<target name="ejbca:deployprompt" depends="ejbca:deploytrustprompt">
<input message="Please enter the password of the keystore with the TLS key for https" addproperty="httpsserver.password" defaultvalue="serverpwd">
<handler classname="org.apache.tools.ant.input.SecureInputHandler" />
</input>
</target>
<target name="ejbca:prompt">
<input message="Please enter the CA name (default: ManagementCA) ?" addproperty="ca.name" defaultvalue="ManagementCA"/>
<input message="Please enter the CA dn (default: CN=ManagementCA,O=EJBCA Sample,C=SE) ?" addproperty="ca.dn" defaultvalue="CN=ManagementCA,O=EJBCA Sample,C=SE"/>
<input message="Please enter the CA key type (default: RSA) ?" addproperty="ca.keytype" defaultvalue="RSA" />
<input message="Please enter the CA key spec (default: 2048) ?" addproperty="ca.keyspec" defaultvalue="2048" />
<input message="Please enter the CA signature algorithm (default: SHA256WithRSA) ?" addproperty="ca.signaturealgorithm" defaultvalue="SHA256WithRSA" />
<input message="Please enter the CA validity in days (default: 3650) ?" addproperty="ca.validity" defaultvalue="3650"/>
<input message="Please enter the CA policy id (default, no policy) ?" addproperty="ca.policy" defaultvalue="null"/>
<echo message="To set httpsserver.hostname you need to configure conf/web.properties. See sample config file conf/web.properties.sample."/>
<input message="Please enter the server hostname (default 'localhost') ?" addproperty="httpsserver.hostname" defaultvalue="localhost"/>
<echo message=""/>
<echo message="Common Name (CN) of httpsserver dn is by default taken from the httpsserver.hostname."/>
<input message="Please enter the server dn (default: CN=${httpsserver.hostname},O=EJBCA Sample,C=SE) ?" addproperty="httpsserver.dn" defaultvalue="CN=${httpsserver.hostname},O=EJBCA Sample,C=SE"/>
<input message="Please enter the superadmin cn (default: SuperAdmin) ?" addproperty="superadmin.cn" defaultvalue="SuperAdmin"/>
<input message="Please enter the superadmin dn (default: CN=${superadmin.cn}) ?" addproperty="superadmin.dn" defaultvalue="CN=${superadmin.cn}"/>
<input message="Please enter the if superadmin keystore should be batched (default: true) ?" addproperty="superadmin.batch" defaultvalue="true"/>
<input message="Please enter the superadmin password (default: ejbca) ?" addproperty="superadmin.password" defaultvalue="ejbca">
<handler classname="org.apache.tools.ant.input.SecureInputHandler" />
</input>
<input message="Enter password CA token password: " addproperty="ca.tokenpassword" defaultvalue="null">
<handler classname="org.apache.tools.ant.input.SecureInputHandler" />
</input>
</target>
<target name="ejbca:init" depends="ejbca:prompt, ejbca:deployprompt">
<echo>
------------------- CA Properties ----------------
ca.name : ${ca.name}
ca.dn : ${ca.dn}
ca.tokentype : ${ca.tokentype}
ca.keytype : ${ca.keytype}
ca.keyspec : ${ca.keyspec}
ca.signaturealgorithm : ${ca.signaturealgorithm}
ca.validity : ${ca.validity}
ca.policy : ${ca.policy}
ca.tokenproperties : ${ca.tokenproperties}
httpsserver.hostname : ${httpsserver.hostname}
httpsserver.dn : ${httpsserver.dn}
superadmin.cn : ${superadmin.cn}
superadmin.dn : ${superadmin.dn}
superadmin.batch : ${superadmin.batch}
appserver.home : ${appserver.home}
</echo>
</target>
<target name="ejbca:javatruststore" depends="ejbca:deploytrustprompt" description="Java trust store config">
<!-- prompt for ca name, but only if it has not been set in install.properties or prompted for already during install -->
<input message="Enter name of CA to add to truststore" addproperty="ca.name"/>
<echo message="Getting root certificate in DER format..."/>
<ejbca:cli arg="ca getcacert "${ca.name}" ${java.io.tmpdir}/rootca.der -der"/>
<property name="trust.keystore" value="${ejbca.home}/p12/truststore.jks"/>
<property name="trust.password" value="${java.trustpassword}"/>
<echo>Adding to or creating keystore: ${trust.keystore}</echo>
<!-- The 'available' below only works when trust.keystore is a full path, otherwise the keytool command runs in user.dir while available looks in bin so it returns the wrong value. -->
<available file="${trust.keystore}" property="javatruststore.file.present"/>
<!-- If the above did not set the property it might be that we did not give a full path, in which case we should try again from the user.dir, where keytool is run -->
<available file="${user.dir}/${trust.keystore}" property="javatruststore.file.present"/>
<antcall target="ejbca:javatruststore-removeold"/>
<ejbca:keytool arg="-v -alias "${ca.name}" -import -trustcacerts -file '${java.io.tmpdir}/rootca.der' -keystore '${trust.keystore}' -storepass ${trust.password} -noprompt"/>
<delete file="${java.io.tmpdir}/rootca.der"/>
</target>
<target name="ejbca:javatruststore-removeold" if="javatruststore.file.present">
<ejbca:keytool arg="-v -alias "${ca.name}" -delete -keystore '${trust.keystore}' -storepass ${trust.password}"/>
</target>
<target name="ejbca:install" depends="check:bootstrapdone, ejbca:init" description="Install">
<antcall target="ejbca:initCA" />
<antcall target="ejbca:adminweb"/>
<antcall target="ejbca:javatruststore"/>
</target>
<!-- Property used to specify certificate profile different from the defautl ROOTCA or SUBCA profile
Specify in install.properties (ca.certificateprofile) for initial installation CA -->
<condition property="install.certprofile.command" value="-certprofile "${ca.certificateprofile}"" else="">
<isset property="ca.certificateprofile" />
</condition>
<condition property="install.catoken.command" value="--tokenprop "${ca.tokenproperties}"" else="">
<isset property="ca.tokenproperties" />
</condition>
<target name="ejbca:initCA" >
<echo message="Initializing CA with '${ca.name}' '${ca.dn}' '${ca.tokentype}' '<ca.tokenpassword hidden>' '${ca.keyspec}' '${ca.keytype}' '${ca.validity}' '${ca.policy}' '${ca.signaturealgorithm}' ${install.catoken.command} ${install.certprofile.command} -superadmincn '${superadmin.cn}'..." />
<ejbca:cli-hideargs arg="ca init "${ca.name}" "${ca.dn}" ${ca.tokentype} "${ca.tokenpassword}" ${ca.keyspec} ${ca.keytype} ${ca.validity} ${ca.policy} ${ca.signaturealgorithm} ${install.catoken.command} ${install.certprofile.command} -superadmincn "${superadmin.cn}""/>
</target>
<target name="ejbca:adminweb">
<!-- Add an altname of 127.0.0.1 if the httpsservers hostname is localhost, otherwise add and altname with the same dnsName as hostname. -->
<condition property="httpsserver.an" value="dnsName=localhost,IPAddress=127.0.0.1" else="dnsName=${httpsserver.hostname}">
<contains string="${httpsserver.dn}" substring="CN=localhost,"/>
</condition>
<ejbca:cli-hideargs arg="ra addendentity tomcat --password ${httpsserver.password} "${httpsserver.dn}" --altname "${httpsserver.an}" "${ca.name}" 1 JKS --certprofile SERVER"/>
<ejbca:cli-hideargs arg="ra setclearpwd tomcat ${httpsserver.password}"/>
<ejbca:cli arg="batch tomcat"/>
<condition property="superadmin.keystoretype" value="P12" else="USERGENERATED">
<istrue value="${superadmin.batch}" />
</condition>
<condition property="sa.validity" value="${superadmin.validity}" else="">
<isset property="superadmin.validity" />
</condition>
<condition property="sa.validity.flag" value="--validity" else="">
<isset property="superadmin.validity" />
</condition>
<ejbca:cli-hideargs arg="ra addendentity superadmin --password ${superadmin.password} "${superadmin.dn}" "${ca.name}" 1 ${superadmin.keystoretype} ${sa.validity.flag} ${sa.validity}"/>
<ejbca:cli-hideargs arg="ra setclearpwd superadmin ${superadmin.password}" />
<!--
this does not work for some reason, if I'm not forking the VM, I'm wondering
if it is not an issue with the Ant classloader
For in ejbca.home in order to have the p12 directory as a child of it.
-->
<delete file="${ejbca.home}/p12/superadmin.p12" quiet="true"/>
<condition property="superadmin.batch.true" value="set">
<istrue value="${superadmin.batch}" />
</condition>
<antcall target="ejbca:batchsuperadmin"/>
<fail message="Batch generation failed!">
<condition>
<or>
<not><available filepath="${ejbca.home}/p12" file="tomcat.jks"/></not>
<and>
<not><available filepath="${ejbca.home}/p12" file="superadmin.p12"/></not>
<istrue value="${superadmin.batch}" />
</and>
</or>
</condition>
</fail>
</target>
<target name="ejbca:renew-keystore" description="Renews the keystore used by the application server for https access.">
<ejbca:cli-hideargs arg="ra setendentitystatus tomcat 10"/>
<ejbca:cli-hideargs arg="ra setclearpwd tomcat ${httpsserver.password}"/>
<ejbca:cli arg="batch tomcat"/>
</target>
<!-- Only try to batch generate superadmin if if keystoretyp is P12 -->
<target name="ejbca:batchsuperadmin" if="superadmin.batch.true">
<ejbca:cli arg="batch superadmin"/>
</target>
<target name="ejbca:cli" description="Handy hook to run a command">
<ejbca:cli name="${cli.name}" arg="${cli.args}"/>
</target>
<!-- ejbca:setup:selenium-profiles -->
<target name="ejbca:setup:selenium-certificates">
<mkdir dir="${ejbca.home}/p12" />
<!-- Roles:
* Role Template 'Auditor' - SeleniumAuditorRole;
* Role Template 'CA Administrators' - SeleniumCaAdminRole;
* Role Template 'RA Administrators' - SeleniumRaAdminRole;
* Role Template 'Super Administrators' - SeleniumSuperAdminRole;
* Role Template 'Supervisors' - SeleniumSupervisorRole.
-->
<antcall target="ejbca:setup:selenium-role">
<param name="roleName" value="SeleniumAuditorRole" />
<param name="ruleStrings" value="
/administrator/;
/ca/;
/ca_functionality/view_approval_profiles/;
/ca_functionality/view_ca/;
/ca_functionality/view_certificate/;
/ca_functionality/view_certificate_profiles/;
/ca_functionality/view_publisher/;
/ca_functionality/view_validator/;
/cryptotoken/view/;
/internalkeybinding/view/;
/peer/view/;
/ra_functionality/view_end_entity/;
/ra_functionality/view_end_entity_history/;
/ra_functionality/view_end_entity_profiles/;
/secureaudit/auditor/select/;
/services/view/;
/system_functionality/view_administrator_privileges/;
/system_functionality/view_available_custom_certificate_extensions/;
/system_functionality/view_available_extended_key_usages/;
/system_functionality/view_systemconfiguration/" />
</antcall>
<antcall target="ejbca:setup:selenium-role">
<param name="roleName" value="SeleniumCaAdminRole" />
<param name="ruleStrings" value="
/administrator/;
/ca/;
/ca_functionality/;
/cryptotoken/view/;
/ra_functionality/;
/system_functionality/edit_administrator_privileges/;
/system_functionality/view_administrator_privileges/" />
</antcall>
<antcall target="ejbca:setup:selenium-role">
<param name="roleName" value="SeleniumRaAdminRole" />
<param name="ruleStrings" value="
/administrator/;
/ca/;
/ca_functionality/create_certificate/;
/ca_functionality/view_certificate/;
/ra_functionality/approve_end_entity/;
/ra_functionality/create_end_entity/;
/ra_functionality/delete_end_entity/;
/ra_functionality/edit_end_entity/;
/ra_functionality/revoke_end_entity/;
/ra_functionality/view_approvals/;
/ra_functionality/view_end_entity/;
/ra_functionality/view_end_entity_history/;
/secureaudit/auditor/select/" />
</antcall>
<antcall target="ejbca:setup:selenium-role">
<param name="roleName" value="SeleniumSuperAdminRole" />
<param name="ruleStrings" value="/" />
</antcall>
<antcall target="ejbca:setup:selenium-role">
<param name="roleName" value="SeleniumSupervisorRole" />
<param name="ruleStrings" value="
/administrator/;
/ca/;
/ca_functionality/view_certificate/;
/ra_functionality/view_end_entity/;
/ra_functionality/view_end_entity_history/;
/secureaudit/auditor/select/" />
</antcall>
<!-- Users:
* SeleniumAuditor (SeleniumAuditorRole);
* SeleniumCaAdmin (SeleniumCaAdminRole);
* SeleniumRaAdmin (SeleniumRaAdminRole);
* SeleniumRaAdmin1 (SeleniumRaAdminRole);
* SeleniumSuperAdmin (SeleniumSuperAdminRole);
* SeleniumSupervisor (SeleniumSupervisorRole).
-->
<antcall target="ejbca:setup:selenium-endentity">
<param name="roleName" value="SeleniumAuditorRole" />
<param name="userName" value="SeleniumAuditor" />
<param name="dnName" value="CN=SeleniumAuditor" />
<param name="caName" value="${target.clientcert.ca}" />
<param name="typeValue" value="1" />
<param name="tokenValue" value="P12" />
<param name="passwordValue" value="ejbca" />
<param name="eeProfileName" value="EMPTY" />
<param name="cProfileName" value="ENDUSER" />
</antcall>
<antcall target="ejbca:setup:selenium-endentity">
<param name="roleName" value="SeleniumCaAdminRole" />
<param name="userName" value="SeleniumCaAdmin" />
<param name="dnName" value="CN=SeleniumCaAdmin" />
<param name="caName" value="${target.clientcert.ca}" />
<param name="typeValue" value="1" />
<param name="tokenValue" value="P12" />
<param name="passwordValue" value="ejbca" />
<param name="eeProfileName" value="EMPTY" />
<param name="cProfileName" value="ENDUSER" />
</antcall>
<antcall target="ejbca:setup:selenium-endentity">
<param name="roleName" value="SeleniumRaAdminRole" />
<param name="userName" value="SeleniumRaAdmin" />
<param name="dnName" value="CN=SeleniumRaAdmin" />
<param name="caName" value="${target.clientcert.ca}" />
<param name="typeValue" value="1" />
<param name="tokenValue" value="P12" />
<param name="passwordValue" value="ejbca" />
<param name="eeProfileName" value="EMPTY" />
<param name="cProfileName" value="ENDUSER" />
</antcall>
<antcall target="ejbca:setup:selenium-endentity">
<param name="roleName" value="SeleniumRaAdminRole" />
<param name="userName" value="SeleniumRaAdmin1" />
<param name="dnName" value="CN=SeleniumRaAdmin1" />
<param name="caName" value="${target.clientcert.ca}" />
<param name="typeValue" value="1" />
<param name="tokenValue" value="P12" />
<param name="passwordValue" value="ejbca" />
<param name="eeProfileName" value="EMPTY" />
<param name="cProfileName" value="ENDUSER" />
</antcall>
<antcall target="ejbca:setup:selenium-endentity">
<param name="roleName" value="SeleniumSuperAdminRole" />
<param name="userName" value="SeleniumSuperAdmin" />
<param name="dnName" value="CN=SeleniumSuperAdmin" />
<param name="caName" value="${target.clientcert.ca}" />
<param name="typeValue" value="1" />
<param name="tokenValue" value="P12" />
<param name="passwordValue" value="ejbca" />
<param name="eeProfileName" value="EMPTY" />
<param name="cProfileName" value="ENDUSER" />
</antcall>
<antcall target="ejbca:setup:selenium-endentity">
<param name="roleName" value="SeleniumSupervisorRole" />
<param name="userName" value="SeleniumSupervisor" />
<param name="dnName" value="CN=SeleniumSupervisor" />
<param name="caName" value="${target.clientcert.ca}" />
<param name="typeValue" value="1" />
<param name="tokenValue" value="P12" />
<param name="passwordValue" value="ejbca" />
<param name="eeProfileName" value="EMPTY" />
<param name="cProfileName" value="ENDUSER" />
</antcall>
</target>
<target name="ejbca:setup:selenium-role">
<ejbca:cli-hideargs arg="roles addrole --role ${roleName}" />
<!-- Add Rules -->
<script language="javascript"> <![CDATA[
var roleName = project.getProperty('roleName');
var rulesArray = project.getProperty('ruleStrings').split(';');
for (i = 0; i < rulesArray.length; i++) {
var macro = project.createTask("ejbca:cli-hideargs");
macro.setDynamicAttribute("arg", "roles changerule --name " + roleName +" --rule " + rulesArray[i].trim() + " --state ACCEPT");
macro.execute();
}
]]></script>
</target>
<target name="ejbca:setup:selenium-endentity">
<ejbca:cli-hideargs arg="ra addendentity --username ${userName} --dn ${dnName} --caname ${caName} --type ${typeValue} --token ${tokenValue} --password ${passwordValue} --eeprofile ${eeProfileName} --certprofile ${cProfileName}" />
<ejbca:cli-hideargs arg="ra setclearpwd --username ${userName} --password ${passwordValue}" />
<ejbca:cli arg="batch --username ${userName} -dir ${ejbca.home}/p12" />
<ejbca:cli-hideargs arg="roles addrolemember --role ${roleName} --caname ${caName} --with WITH_COMMONNAME --value ${userName} --description 'Selenium Test User ${userName}'" />
</target>
<target name="ejbca:setup:selenium-firefox-profiles:update">
<property name="regexp" value="^Path=(.*?).${firefoxProfileName}$" />
<loadfile property="firefoxProfilePath" srcfile="${firefoxProfilesDir}/profiles.ini">
<filterchain>
<tokenfilter>
<containsregex pattern="${regexp}" replace="\1" />
</tokenfilter>
<striplinebreaks />
</filterchain>
</loadfile>
<property name="firefoxProfileDir" value="${firefoxProfilesDir}${firefoxProfilePath}.${firefoxProfileName}" />
<ejbca:certutil arg="-N -d 'sql:${firefoxProfileDir}' --empty-password" />
<ejbca:pk12util arg="-i ${ejbca.home}/p12/${firefoxProfileName}.p12 -d 'sql:${firefoxProfileDir}' -W ejbca" />
</target>
<target name="ejbca:setup:selenium-firefox-path-in-properties">
<available file="browser.properties"
filepath="${ejbca.home}/modules/ejbca-webtest/conf/"
property="firefox-path-is-in-properties" />
</target>
<target name="ejbca:setup:selenium-firefox-path-in-properties-read" depends="ejbca:setup:selenium-firefox-path-in-properties" if="firefox-path-is-in-properties">
<loadproperties srcFile="${ejbca.home}/modules/ejbca-webtest/conf/browser.properties" />
</target>
<target name="ejbca:setup:selenium-firefox" depends="ejbca:setup:selenium-firefox-path-in-properties-read">
<property environment="env" />
<condition property="hasFirefoxInPath" value="true" else="">
<available file="firefox" filepath="${env.PATH}/" />
</condition>
<fail message="Cannot find 'firefox' command in your browser.properties or in your PATH.">
<condition>
<and>
<not>
<isset property="browser.firefox.binary" />
</not>
<equals arg1="${hasFirefoxInPath}" arg2="" />
</and>
</condition>
</fail>
<property name="browser.firefox.binary" value="firefox" />
</target>
<target name="ejbca:setup:selenium-firefox-profiles" depends="ejbca:setup:selenium-firefox">
<condition property="isWindows">
<os family="windows" />
</condition>
<fail message="Windows OS is not supported for automated creation of Firefox profiles." if="isWindows" />
<condition property="isUnix">
<os family="unix" />
</condition>
<fail message="Cannot detect the OS." unless="isUnix" />
<property environment="env" />
<!-- libnss3-tools utility -->
<available file="certutil"
filepath="${env.PATH}"
property="hasCertutil" />
<fail message="Cannot find 'certutil' command in your PATH (Do you have Mozilla NSS Tools Installed?)." unless="hasCertutil" />
<!-- libnss3-tools utility -->
<available file="pk12util"
filepath="${env.PATH}"
property="hasPk12util" />
<fail message="Cannot find 'pk12util' command in your PATH (Do you have Mozilla NSS Tools Installed?)." unless="hasPk12util" />
<condition property="linuxProfilePath" value="${env.HOME}/.mozilla/firefox/" else="">
<available file="${env.HOME}/.mozilla/firefox" type="dir" />
</condition>
<condition property="macProfilePath" value="${env.HOME}/Library/Application Support/Firefox/" else="">
<available file="${env.HOME}/Library/Application Support/Firefox/" type="dir" />
</condition>
<echo message="HOME: ${env.HOME}/.mozilla/firefox/"/>
<fail message="Cannot find profiles.ini dir for Linux and Mac">
<condition>
<and>
<equals arg1="${linuxProfilePath}" arg2="" />
<equals arg1="${macProfilePath}" arg2=""/>
</and>
</condition>
</fail>
<condition property="firefoxProfilesDir" value="${linuxProfilePath}" else="${macProfilePath}">
<not>
<equals arg1="${linuxProfilePath}" arg2="" />
</not>
</condition>
<!-- Create profiles and folders -->
<ejbca:firefox firefoxExecPath="${browser.firefox.binary}" arg="-no-remote -CreateProfile SeleniumAuditor" />
<ejbca:firefox firefoxExecPath="${browser.firefox.binary}" arg="-no-remote -CreateProfile SeleniumCaAdmin" />
<ejbca:firefox firefoxExecPath="${browser.firefox.binary}" arg="-no-remote -CreateProfile SeleniumRaAdmin" />
<ejbca:firefox firefoxExecPath="${browser.firefox.binary}" arg="-no-remote -CreateProfile SeleniumRaAdmin1" />
<ejbca:firefox firefoxExecPath="${browser.firefox.binary}" arg="-no-remote -CreateProfile SeleniumSuperAdmin" />
<ejbca:firefox firefoxExecPath="${browser.firefox.binary}" arg="-no-remote -CreateProfile SeleniumSupervisor" />
<!-- Create certificate stores and import p12 -->
<!-- SeleniumAuditor -->
<antcall target="ejbca:setup:selenium-firefox-profiles:update">
<param name="firefoxProfilesDir" value="${firefoxProfilesDir}" />
<param name="firefoxProfileName" value="SeleniumAuditor" />
</antcall>
<!-- SeleniumCaAdmin -->
<antcall target="ejbca:setup:selenium-firefox-profiles:update">
<param name="firefoxProfilesDir" value="${firefoxProfilesDir}" />
<param name="firefoxProfileName" value="SeleniumCaAdmin" />
</antcall>
<!-- SeleniumRaAdmin -->
<antcall target="ejbca:setup:selenium-firefox-profiles:update">
<param name="firefoxProfilesDir" value="${firefoxProfilesDir}" />
<param name="firefoxProfileName" value="SeleniumRaAdmin" />
</antcall>
<!-- SeleniumRaAdmin1 -->
<antcall target="ejbca:setup:selenium-firefox-profiles:update">
<param name="firefoxProfilesDir" value="${firefoxProfilesDir}" />
<param name="firefoxProfileName" value="SeleniumRaAdmin1" />
</antcall>
<!-- SeleniumSuperAdmin -->
<antcall target="ejbca:setup:selenium-firefox-profiles:update">
<param name="firefoxProfilesDir" value="${firefoxProfilesDir}" />
<param name="firefoxProfileName" value="SeleniumSuperAdmin" />
</antcall>
<!-- SeleniumSupervisor -->
<antcall target="ejbca:setup:selenium-firefox-profiles:update">
<param name="firefoxProfilesDir" value="${firefoxProfilesDir}" />
<param name="firefoxProfileName" value="SeleniumSupervisor" />
</antcall>
</target>
<!--
==============================================================================
macro definitions
==============================================================================
-->
<macrodef name="cli" uri="ejbca">
<attribute name="arg"/>
<sequential>
<echo message="@{arg}"/>
<java dir="${ejbca.home}" jar="${ejbca.home}/dist/ejbca-ejb-cli/ejbca-ejb-cli.jar" fork="true">
<arg line="@{arg}"/>
</java>
</sequential>
</macrodef>
<macrodef name="cli-hideargs" uri="ejbca" description="same as 'cli', but does not output the given arguments to console">
<attribute name="arg"/>
<sequential>
<java dir="${ejbca.home}" jar="${ejbca.home}/dist/ejbca-ejb-cli/ejbca-ejb-cli.jar" fork="true" failonerror="true">
<arg line="@{arg}"/>
</java>
</sequential>
</macrodef>
<macrodef name="keytool" uri="ejbca">
<attribute name="arg"/>
<sequential>
<condition property="temp.keytoolhome" value="${env.JAVA_HOME}/bin/" else="">
<and>
<isset property="env.JAVA_HOME" />
<not>
<equals arg1="${env.JAVA_HOME}" arg2="" />
</not>
</and>
</condition>
<exec executable="${temp.keytoolhome}keytool" dir="${user.dir}">
<arg line="@{arg}"/>
</exec>
</sequential>
</macrodef>
<macrodef name="firefox" uri="ejbca">
<attribute name="firefoxExecPath" />
<attribute name="arg"/>
<sequential>
<exec executable="@{firefoxExecPath}" failonerror="true">
<env key="USER" value="${env.USER}" />
<env key="HOME" value="${env.HOME}"/>
<arg line="@{arg}"/>
</exec>
</sequential>
</macrodef>
<macrodef name="certutil" uri="ejbca">
<attribute name="arg"/>
<sequential>
<exec executable="certutil">
<arg line="@{arg}"/>
</exec>
</sequential>
</macrodef>
<macrodef name="pk12util" uri="ejbca">
<attribute name="arg"/>
<sequential>
<exec executable="pk12util">
<arg line="@{arg}"/>
</exec>
</sequential>
</macrodef>
</project>