- A web application for signing e-invoice documents in accordance with the algorithm specified by the Egyptian Tax Authority (ETA).
- JDK 17
- Oracle JDK 17 can be downloaded from here.
-
Clone the repository to your local environment:
git clone https://github.com/mostafaism1/eta-einvoice-signer
cd eta-einvoice-signer
-
Build the project:
./mvnw clean package
-
The previous step will output the following artifact in the target directory:
eta-einvoice-signer
- Configuration properties should be placed in the
application.properties
file ateta-einvoice-signer/WEB-INF/classes
(see below for all available configuration properties.)
- The application supports 2 types of keystores for signature creation:
- Hardware token keystore
- File-based keystore
- Set
signature.keystore.type
tohardware
, and set the following properties:signature.keystore.pkcs11ConfigFilePath
signature.keystore.password
signature.keystore.certificateIssuerName
- Set
signature.keystore.type
tofile
, and set the following properties:signature.keystore.pkcs12KeyStoreFilePath
signature.keystore.password
signature.keystore.certificateIssuerName
- The application uses HTTP Basic authentication.
- Only 1 user can be defined.
- To configure the user's details:
- Set
auth.user.userName
to the user name. - Set
auth.user.encryptedPassword
to the bcrypt hash of the password.- There are many tools to generate a bcrypt hash. Here's one such tool.
- Set
- Deploy the directory
eta-einvoice-signer
to a java application server such as tomcat.
-
/eta-einvoice-signer
-
Request
- Method
- POST
- Headers
- Basic authentication header
- Body
- A json object containing a single key "documents" and whose value is an array of document objects
- Method
-
Response
- Body
- The body of the request with the signature appended to each document.
- Example:
- Body
-