diff --git a/examples/UEFA/Makefile b/examples/UEFA/Makefile new file mode 100644 index 00000000..cce5a256 --- /dev/null +++ b/examples/UEFA/Makefile @@ -0,0 +1,38 @@ +XMLSECTOOL=xmlsectool +KEYSTORE= +KEY=1 +KEYPASSWORD= +SIGNATURE_ALGORITHM=rsa-sha256 + +help: + # Needs a target, example: $$ make EntryToken.canonicalized.xml + # + # Let's say you have a TokenScript "EntryToken.xml" + #- to validate and canonicalize, add 'canonicalized' in the filename + @echo $$ make EntryToken.canonicalized.xml + # - to sign, use tsml as file extension: + @echo $$ make EntryToken.tsml + +%.canonicalized.xml : %.xml + # xmlsectool canonicalises automatically when needed, but leaving an xml:base attribute which creates trouble later. + # xmlstarlet does it neatly + # XML Canonicalization + xmlstarlet c14n $^ > $@ + # xmlsectool validates too, albeit adding xml:base with breaks schema. Example: + # JVMOPTS=-Djavax.xml.accessExternalDTD=all /opt/xmlsectool-2.0.0/xmlsectool.sh --validateSchema --xsd --schemaDirectory ../../schema --inFile $^ + # XML Validation + # if INVALID, run validation again with xmllint to get meaningful error + # then delete the canonicalized file + -xmlstarlet val --xsd http://tokenscript.org/2019/10/tokenscript/tokenscript.xsd $@ || (mv $@ $@.INVALID; xmllint --noout --schema http://tokenscript.org/2019/10/tokenscript/tokenscript.xsd $@.INVALID) + +%.tsml: %.canonicalized.xml +ifeq (,$(KEYSTORE)) + @echo ---------------- Keystore missing. Try this ---------------- + @echo $$ make KEYSTORE=shong.wang.p12 KEYPASSWORD=shong.wang $@ + @echo replace it with your .p12 file and your password + rm $^ +else + $(XMLSECTOOL) --sign --keyInfoKeyName 'Shong Wang' --digest SHA-256 --signatureAlgorithm http://www.w3.org/2001/04/xmldsig-more#$(SIGNATURE_ALGORITHM) --inFile $^ --outFile $@ --keystore $(KEYSTORE) --keystoreType PKCS12 --key $(KEY) --keyPassword $(KEYPASSWORD) --signaturePosition LAST + # removing the canonicalized created for validation + rm $^ +endif diff --git a/examples/UEFA/UEFA.en.shtml b/examples/UEFA/UEFA.en.shtml new file mode 100644 index 00000000..bdbd8995 --- /dev/null +++ b/examples/UEFA/UEFA.en.shtml @@ -0,0 +1,147 @@ + + +
diff --git a/examples/UEFA/UEFA.xml b/examples/UEFA/UEFA.xml new file mode 100644 index 00000000..c41e9040 --- /dev/null +++ b/examples/UEFA/UEFA.xml @@ -0,0 +1,230 @@ + + + + ]> + + + + Ticket + Tickets + + + + + 0xc2f901070AdcfA07Bc5c46cc2390063248eb9E81 + + + + + + + + + + + + + &UEFA.en; + + + &UEFA.en; + + + + + + + + + Time + + + + + + + + + + City + + + + + + Copenhagen + + + Saint Petersburg + + + Amsterdam + + + Bucharest + + + London + + + Glasgow + + + Bilbao + + + Dublin + + + Budapest + + + Munich + + + Baku + + + Rome + + + + + + + + + Venue + + + + + + Olimpico in Roma + + + Baku Olym[oc Stadium + + + Parken Stadium + + + Saint Petersburg Stadium + + + Johan Cruijff Arena + + + National Arena Bucharest + + + Wembley Stadium + + + Hampden Park + + + San Mames stadium + + + Dublin Arena + + + Puskas Ferenc Stadium + + + Allianz Arena + + + + + + + + + + Team A + + + + + + + + + Team B + + + + + + + + + Match + + + + + + + + + Cat + 等级 + Cat + + + + + + The Club (Club2020) + + + The Lounge (Prestige) + + + The Suite (Silver) + + + The Suite (Gold) + + + + + + + + + + + + + + + + + + Redeemed + + + + + + + + + + + + diff --git a/examples/UEFA/shared.css b/examples/UEFA/shared.css new file mode 100644 index 00000000..bdd0f91a --- /dev/null +++ b/examples/UEFA/shared.css @@ -0,0 +1,46 @@ +.tbml-count { + font-family: "SourceSansPro"; + font-weight: bolder; + font-size: 21px; + color: rgb(117, 185, 67); +} +.tbml-category { + font-family: "SourceSansPro"; + font-weight: lighter; + font-size: 21px; + color: rgb(67, 67, 67); +} +.tbml-venue { + font-family: "SourceSansPro"; + font-weight: lighter; + font-size: 16px; + color: rgb(67, 67, 67); +} +.tbml-date { + font-family: "SourceSansPro"; + font-weight: bold; + font-size: 14px; + color: rgb(112, 112, 112); + margin-left: 7px; + margin-right: 7px; +} +.tbml-time { + font-family: "SourceSansPro"; + font-weight: lighter; + font-size: 16px; + color: rgb(112, 112, 112); +} +html { +} +body { + padding: 0px; + margin: 0px; +} +div { + margin: 0px; + padding: 0px; +} +.data-icon { + height:16px; + vertical-align: middle +} \ No newline at end of file