├── NOTICE ├── stunnel-eet └── win32 │ ├── zlib1.dll │ ├── libeay32.dll │ ├── msvcr90.dll │ ├── ssleay32.dll │ ├── stunnel.exe │ ├── tstunnel.exe │ ├── eet.conf │ ├── Microsoft.VC90.CRT.Manifest │ ├── README.md │ ├── ca-eet.pem │ └── LICENSE ├── releases └── prerelease │ ├── openeet-lite-java7-20160809-1422.jar │ ├── openeet-lite-java7-20160816-2123.jar │ ├── openeet-lite-java7-20160923-0840.jar │ ├── openeet-lite-java7-20170115-0140.jar │ ├── openeet-lite-java7-20190610-1420.jar │ ├── openeet-lite-java8-20160809-1420.jar │ ├── openeet-lite-java8-20160816-2119.jar │ ├── openeet-lite-java8-20160923-0840.jar │ ├── openeet-lite-java8-20170115-0140.jar │ ├── openeet-lite-shapshot-20170303-1130.zip │ ├── openeet-lite-shapshot-20160705-0835.dll │ ├── openeet-lite-shapshot-20160805-0622.jar │ ├── openeet-lite-shapshot-20160911-1837.dll │ └── openeet-lite-shapshot-jar-20160701-0939.jar ├── CONTRIBUTING.md ├── README.md └── LICENSE /NOTICE: -------------------------------------------------------------------------------- 1 | OpenEET 2 | Copyright 2016 Luděk Rašek 3 | -------------------------------------------------------------------------------- /stunnel-eet/win32/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/l-ra/openeet/HEAD/stunnel-eet/win32/zlib1.dll -------------------------------------------------------------------------------- /stunnel-eet/win32/libeay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/l-ra/openeet/HEAD/stunnel-eet/win32/libeay32.dll -------------------------------------------------------------------------------- /stunnel-eet/win32/msvcr90.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/l-ra/openeet/HEAD/stunnel-eet/win32/msvcr90.dll -------------------------------------------------------------------------------- /stunnel-eet/win32/ssleay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/l-ra/openeet/HEAD/stunnel-eet/win32/ssleay32.dll -------------------------------------------------------------------------------- /stunnel-eet/win32/stunnel.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/l-ra/openeet/HEAD/stunnel-eet/win32/stunnel.exe -------------------------------------------------------------------------------- /stunnel-eet/win32/tstunnel.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/l-ra/openeet/HEAD/stunnel-eet/win32/tstunnel.exe -------------------------------------------------------------------------------- /releases/prerelease/openeet-lite-java7-20160809-1422.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/l-ra/openeet/HEAD/releases/prerelease/openeet-lite-java7-20160809-1422.jar -------------------------------------------------------------------------------- /releases/prerelease/openeet-lite-java7-20160816-2123.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/l-ra/openeet/HEAD/releases/prerelease/openeet-lite-java7-20160816-2123.jar -------------------------------------------------------------------------------- /releases/prerelease/openeet-lite-java7-20160923-0840.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/l-ra/openeet/HEAD/releases/prerelease/openeet-lite-java7-20160923-0840.jar -------------------------------------------------------------------------------- /releases/prerelease/openeet-lite-java7-20170115-0140.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/l-ra/openeet/HEAD/releases/prerelease/openeet-lite-java7-20170115-0140.jar -------------------------------------------------------------------------------- /releases/prerelease/openeet-lite-java7-20190610-1420.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/l-ra/openeet/HEAD/releases/prerelease/openeet-lite-java7-20190610-1420.jar -------------------------------------------------------------------------------- /releases/prerelease/openeet-lite-java8-20160809-1420.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/l-ra/openeet/HEAD/releases/prerelease/openeet-lite-java8-20160809-1420.jar -------------------------------------------------------------------------------- /releases/prerelease/openeet-lite-java8-20160816-2119.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/l-ra/openeet/HEAD/releases/prerelease/openeet-lite-java8-20160816-2119.jar -------------------------------------------------------------------------------- /releases/prerelease/openeet-lite-java8-20160923-0840.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/l-ra/openeet/HEAD/releases/prerelease/openeet-lite-java8-20160923-0840.jar -------------------------------------------------------------------------------- /releases/prerelease/openeet-lite-java8-20170115-0140.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/l-ra/openeet/HEAD/releases/prerelease/openeet-lite-java8-20170115-0140.jar -------------------------------------------------------------------------------- /releases/prerelease/ openeet-lite-shapshot-20170303-1130.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/l-ra/openeet/HEAD/releases/prerelease/ openeet-lite-shapshot-20170303-1130.zip -------------------------------------------------------------------------------- /releases/prerelease/openeet-lite-shapshot-20160705-0835.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/l-ra/openeet/HEAD/releases/prerelease/openeet-lite-shapshot-20160705-0835.dll -------------------------------------------------------------------------------- /releases/prerelease/openeet-lite-shapshot-20160805-0622.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/l-ra/openeet/HEAD/releases/prerelease/openeet-lite-shapshot-20160805-0622.jar -------------------------------------------------------------------------------- /releases/prerelease/openeet-lite-shapshot-20160911-1837.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/l-ra/openeet/HEAD/releases/prerelease/openeet-lite-shapshot-20160911-1837.dll -------------------------------------------------------------------------------- /releases/prerelease/openeet-lite-shapshot-jar-20160701-0939.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/l-ra/openeet/HEAD/releases/prerelease/openeet-lite-shapshot-jar-20160701-0939.jar -------------------------------------------------------------------------------- /stunnel-eet/win32/eet.conf: -------------------------------------------------------------------------------- 1 | 2 | [eet] 3 | client = yes 4 | accept = 127.0.0.1:27541 5 | connect = pg.eet.cz:443 6 | verifyChain = yes 7 | CAfile = ca-eet.pem 8 | checkHost = pg.eet.cz 9 | OCSPaia = no 10 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute 2 | If you want to contribute, fork the repo, make changes you want and creat a pull request. All improvements are appreciated. 3 | 4 | #Contributors 5 | Following people contributed so far (in order of pull request appearance :-) ): 6 | * https://github.com/jakubpycha 7 | -------------------------------------------------------------------------------- /stunnel-eet/win32/Microsoft.VC90.CRT.Manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /stunnel-eet/win32/README.md: -------------------------------------------------------------------------------- 1 | # stunnel to access EET endpoint 2 | For sources see [stunnel original distribution including sources](https://www.stunnel.org/) 3 | 4 | For stunnel licensing see LICENSE.md. 5 | 6 | This is a subset of official stunnel distribution preconfigured to create tunnel to eet 7 | endpoint to handle TLS 1.1 requirement on older systems. 8 | 9 | To start tunnel in console window run: 10 | 11 | ``` 12 | tstunnel eet.conf 13 | ``` 14 | 15 | To start tunnel in background run: 16 | 17 | ``` 18 | stunnel -quiet eet.conf 19 | ``` 20 | 21 | To run tunnel as a service run (admin privs needed) following command to install a service: 22 | 23 | ``` 24 | stunnel -install eet.conf 25 | ``` 26 | then start the service (admin privs needed) with: 27 | 28 | ``` 29 | stunnel -start 30 | ``` 31 | use netstat to check if the service listens: 32 | ``` 33 | netstat -a -o -n 34 | ``` 35 | and in the output you should see line like this (port depends on your config, PID will differ) 36 | ``` 37 | TCP 127.0.0.1:27541 0.0.0.0:0 LISTENING 4144 38 | ``` 39 | 40 | 41 | When stunnel is running access EET endpoint at `http://localhost:27541/eet/services/EETServiceSOAP/v2` 42 | The port number in the URL depends on this line in `eet.conf`: 43 | ``` 44 | accept = 127.0.0.1:27541 45 | ``` 46 | -------------------------------------------------------------------------------- /stunnel-eet/win32/ca-eet.pem: -------------------------------------------------------------------------------- 1 | GeoTrust Primary Certification Authority - G3 2 | ============================================= 3 | -----BEGIN CERTIFICATE----- 4 | MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UE 5 | BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA4IEdlb1RydXN0 6 | IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFy 7 | eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIz 8 | NTk1OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAo 9 | YykgMjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMT 10 | LUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZI 11 | hvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz+uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5j 12 | K/BGvESyiaHAKAxJcCGVn2TAppMSAmUmhsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdE 13 | c5IiaacDiGydY8hS2pgn5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3C 14 | IShwiP/WJmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exALDmKu 15 | dlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZChuOl1UcCAwEAAaNC 16 | MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMR5yo6hTgMdHNxr 17 | 2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IBAQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9 18 | cr5HqQ6XErhK8WTTOd8lNNTBzU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbE 19 | Ap7aDHdlDkQNkv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD 20 | AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUHSJsMC8tJP33s 21 | t/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2Gspki4cErx5z481+oghLrGREt 22 | -----END CERTIFICATE----- 23 | -------------------------------------------------------------------------------- /stunnel-eet/win32/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | 3 | stunnel license (see COPYRIGHT.GPL for detailed GPL conditions) 4 | 5 | Copyright (C) 1998-2015 Michal Trojnara 6 | 7 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 10 | 11 | You should have received a copy of the GNU General Public License along with this program; if not, see . 12 | 13 | Linking stunnel statically or dynamically with other modules is making a combined work based on stunnel. Thus, the terms and conditions of the GNU General Public License cover the whole combination. 14 | 15 | In addition, as a special exception, the copyright holder of stunnel gives you permission to combine stunnel with free software programs or libraries that are released under the GNU LGPL and with code included in the standard release of OpenSSL under the OpenSSL License (or modified versions of such code, with unchanged license). You may copy and distribute such a system following the terms of the GNU GPL for stunnel and the licenses of the other code concerned. 16 | 17 | Note that people who make modified versions of stunnel are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU General Public License gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception. 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Abandoned 2 | As EET (elektronicka evidence trzeb) was canceled in Czechia - this repoitory is not maintained anymore. It will be kept as a record of history only. 3 | 4 | # OpenEET 5 | Open source light implementation of EET client library (Java, C#, UNIX shell). Working client (XMLDSig, WS-Security, SOAP call) with no external dependencies in 16/25kB JAR/DLL file. Get the devel snapshot and !Try It! (Use the code to get latest fixes&features) 6 | 7 | The project consists of following repositories (no full release yet - use prerelease snapshot or source code): 8 | * [OpenEET Java](https://github.com/l-ra/openeet-java) ![build status](https://camo.githubusercontent.com/596e721ea9e5279dc30fcca1f1f176ae99266289/68747470733a2f2f7472617669732d63692e6f72672f6c2d72612f6f70656e6565742d6a6176612e7376673f6272616e63683d6d6173746572) 9 | * latest build prerelease 10 | * Java 7 [openeet-lite-java7-20190610-1420.jar](/l-ra/openeet/blob/master/releases/prerelease/openeet-lite-java7-20190610-1420.jar) 11 | * [OpenEET Net](https://github.com/l-ra/openeet-net) 12 | * latest prerelease build [openeet-lite-shapshot-20170303-1130.zip](releases/prerelease/openeet-lite-shapshot-20170303-1130.zip) - from now (2016-09-13) .NET mplementation will not progress much in this repo (only bug fixes and protocol changes will be refelcted) - [see fork focuussed on .NET](https://github.com/vlastikcocek/openeet/tree/master/dotnet) 13 | * you might be interested in [Windows XP TLS problem workaround](#windows-xp--tls11-problem) 14 | * [OpenEET Shell](https://github.com/l-ra/openeet-shell) 15 | * [OpenEET JS](https://github.com/l-ra/openeet-js) - PoC implementation in browser Javascript (no deps, webcrypto) 16 | * [OpenEET Android](https://github.com/l-ra/openeet-android) 17 | * [Android Application OpenEET](https://play.google.com/store/apps/details?id=com.github.openeet.openeet) - unmaintained 18 | 19 | 20 | ## Java example: 21 | 22 | ```java 23 | @Test 24 | public void simpleRegistrationProcessTest() throws MalformedURLException, IOException{ 25 | //set minimal business data & certificate with key loaded from pkcs12 file 26 | EetRegisterRequest request=EetRegisterRequest.builder() 27 | .dic_popl("CZ1212121218") 28 | .id_provoz("1") 29 | .id_pokl("POKLADNA01") 30 | .porad_cis("1") 31 | .dat_trzby("2016-06-30T08:43:28+02:00") 32 | .celk_trzba(100.0) 33 | .rezim(0) 34 | .pkcs12(loadStream(getClass().getResourceAsStream("/01000003.p12"))) 35 | .pkcs12password("eet") 36 | .build(); 37 | 38 | //for receipt printing in online mode 39 | String bkp=request.formatBkp(); 40 | assertNotNull(bkp); 41 | 42 | //for receipt printing in offline mode 43 | String pkp=request.formatPkp(); 44 | assertNotNull(pkp); 45 | //the receipt can be now stored for offline processing 46 | 47 | //try send 48 | String requestBody=request.generateSoapRequest(); 49 | assertNotNull(requestBody); 50 | 51 | String response=request.sendRequest(requestBody, new URL("https://pg.eet.cz:443/eet/services/EETServiceSOAP/v3")); 52 | //extract FIK 53 | assertNotNull(response); 54 | assertTrue(response.contains("Potvrzeni fik=")); 55 | //ready to print online receipt 56 | } 57 | ``` 58 | 59 | 60 | ## C# example: 61 | ```c# 62 | public static void simpleRegistrationProcessTest(){ 63 | //set minimal business data & certificate with key loaded from pkcs12 file 64 | EetRegisterRequest request=EetRegisterRequest.builder() 65 | .dic_popl("CZ1212121218") 66 | .id_provoz("1") 67 | .id_pokl("POKLADNA01") 68 | .porad_cis("1") 69 | .dat_trzby("2016-06-30T08:43:28+02:00") 70 | .celk_trzba(100.0) 71 | .rezim(0) 72 | .pkcs12(TestData._01000003) 73 | .pkcs12password("eet") 74 | .build(); 75 | 76 | //for receipt printing in online mode 77 | String bkp=request.formatBkp(); 78 | if (bkp == null) throw new ApplicationException("BKP is null"); 79 | 80 | //for receipt printing in offline mode 81 | String pkp=request.formatPkp(); 82 | if (pkp == null) throw new ApplicationException("PKP is null"); 83 | //the receipt can be now stored for offline processing 84 | 85 | //try send 86 | String requestBody=request.generateSoapRequest(); 87 | if (requestBody == null) throw new ApplicationException("SOAP request is null"); 88 | 89 | String response=request.sendRequest(requestBody, "https://pg.eet.cz:443/eet/services/EETServiceSOAP/v3); 90 | //extract FIK 91 | if (response == null) throw new ApplicationException("response is null"); 92 | if (response.IndexOf("Potvrzeni fik=") < 0) throw new ApplicationException("FIK not found in the response"); 93 | //ready to print online receipt 94 | Console.WriteLine("OK!"); //a bit brief :-) but enough 95 | } 96 | ``` 97 | 98 | ## Other opensource implementations 99 | 100 | There are also other projects implementing EET API client (not related to OpenEET implementation in this repository): 101 | * https://github.com/ondrejnov/eet (PHP, MIT license) 102 | * https://github.com/novakmi/eetlite (Groovy, MIT license) 103 | * https://github.com/mirus77/DelphiEET (Delphi, MIT license) 104 | * https://github.com/todvora/eet-client (Java, MIT license) 105 | * https://github.com/vlastikcocek/openeet/tree/master/dotnet - fork of this repo focussed on the .NET/C# implementation 106 | 107 | ## Windows XP & TLS1.1 problem 108 | To interact with EET endpoint at least TLS v1.1 is needed. [Windows XP does not support TLS 1.0+](https://blogs.msdn.microsoft.com/kaushal/2011/10/02/support-for-ssltls-protocols-on-windows/). The problem canbe solved by SSL/TLS tunneling using stunnel. The tunneeling concept is described in following schema: 109 | 110 | ``` 111 | [aplikace]------http------>[stunnel]-------https/tls/1.1------->[EET Server] 112 | ``` 113 | You can use stunnel distribution tailored to EET needs available in this repo in the [stunnel-eet](stunnel-eet/win32/) folder. The proposed solution was not tested on WinXP yet. Use issue to let me know whether it works or not. 114 | 115 | ##XMLDSig&SOAP&WS-Security approach for restricted devices 116 | As XMLDsig&SOAP&WSS are huge standards, it is hard to find fuully compliant implementation on restricted devices. I decided to work around this. The intention of of this work (for now) is to provide "light" implementation of the EET API clien. 117 | I will decsribe my approach later (not som much spare time now). For now just short intro. You ucan see working PoC in th shell implementation. The concept is based on XMLDSig processing (see spec). XML is preprocessed from the point of view of canonicalization during compile time and then message is constructed using preprocessing results (templates), some (careful) string replacements and basic crytpo primitives (SHA256, SHA1 and RSASSA_PKCS_1_5)which are widely available on most platforms. 118 | 119 | ###Templates preparation 120 | This step take part during library build. It is bound to certain version of the spec and it is automated by calling a script. The "compile time" preprocessing of the example SOAP message produces two blobs. 121 | * xml temmplate - template of the whole SOAP message 122 | * digested data - template needs to be filled in with business data 123 | * signature data - template needs to be filled in with digest computed over the first template 124 | After the template instances with right data in are ready, signature value can be computed. 125 | 126 | The final step fills the computed values into xml template and the message is ready to be sent to EET API. 127 | 128 | The templates are used in all versions of the library. It is necessary to force git not to normalize line ends when clonning. The templates must be binary identical when checking out. Master branch contains template hash validation. In case the hash validation fails (exceptoin during soap message generation), check the files in the templates folder. To reconfigure git not to modify line ends use `git config --global core.autocrlf input` and checkout master branch. 129 | 130 | ##UNIX Shell based Proof of Concept Implementation 131 | Shell implementation of the EET client - working out of box for the simplest case receipt. 132 | Shell experiment available at [shell/](shell/) - it is able to send valid request to playground EET API. 133 | 134 | Follow me [on twitter](https://twitter.com/_lra) if you want to be notified when something great happens to this repo. 135 | 136 | If you want to support me with beer or pizza, Bitcoins are welcomed at 15wuP8HRu29pYNe4jtfiTuGXrWtzdg53Jg 137 | 138 | 139 | 140 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2016 Luděk Rašek 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------