Skip to content

Latest commit

 

History

History
92 lines (61 loc) · 2.53 KB

README.md

File metadata and controls

92 lines (61 loc) · 2.53 KB

ETA E-Invoice Signer

Description

  • A web application for signing e-invoice documents in accordance with the algorithm specified by the Egyptian Tax Authority (ETA).

Installation

Requirements

  • JDK 17
    • Oracle JDK 17 can be downloaded from here.

Building

  • 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

  • Configuration properties should be placed in the application.properties file at eta-einvoice-signer/WEB-INF/classes (see below for all available configuration properties.)

Signature Keystore

  • The application supports 2 types of keystores for signature creation:
    • Hardware token keystore
    • File-based keystore
Hardware Token Keystore
  • Set signature.keystore.type to hardware, and set the following properties:
    • signature.keystore.pkcs11ConfigFilePath
    • signature.keystore.password
    • signature.keystore.certificateIssuerName
File-based Keystore
  • Set signature.keystore.type to file, and set the following properties:
    • signature.keystore.pkcs12KeyStoreFilePath
    • signature.keystore.password
    • signature.keystore.certificateIssuerName

Authentication

  • 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.

Deployment

  • Deploy the directory eta-einvoice-signer to a java application server such as tomcat.

Usage

Available Endpoints

  • /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
    • Response