eParaksts Java Libraries 2.13.1
==============================

REQUIREMENTS
------------

 1. Basic functionality:

    - Java SE version 8u111 or newer:
      * Java Development Kit (JDK)
      * Java Runtime Environment (JRE)
        Download: https://adoptium.net/releases.html

 2. To add digital signatures:

    - PC/SC compatible smartcard reader;

    - Compatible smartcard + PKCS#11 driver:
      * Latvia eID smartcard + eID card middleware;
      * eParaksts smartcard + eParaksts card middleware;


SETUP INSTRUCTIONS
------------------

   - Unpack "eparaksts-lib-{version}.zip" archive into desired directory,
     e.g. "C:\eParakstsLibraries" on Windows or "/opt/eParakstsLibraries" on Unix platforms.

   - Follow the instructions in the "User Manual" documentation,
     located in "eParakstsLibraries/docs/eparaksts-lib-user.pdf" file.


CURRENT VERSION LIMITATIONS
---------------------------

 Digital signatures can be added on the Microsoft Windows, LINUX and MacOSX platforms only.
 Other functionality is fully supported on any operating system that supports Java SE version 8 or newer.


RUNNING SAMPLES
---------------

 Change to "eParakstsLibraries/samples" directory. Open sample.bat in editor and adjust JAVA_HOME
 variable. Execute local file sample.bat without parameters.

 It calls class named "lv.eparaksts.sample.EDoc2Sample" with some default parameters.
 Class "lv.eparaksts.sample.EDoc2Sample" is located in "samples" subdirectories.

 It creates file "sample.edoc" in "samples" directory
 and adds file named "Readme.txt" from eParaksts Java Libraries root directory.

 If you have environment required to add digital signatures, run sample.bat again with 
 parameter containing smartcard PIN. If successful, EDOC file created must contain digital
 signature.

 Please, check source file "EDoc2Sample.java" as example of eParaksts Java Libraries API usage.

 To reduce logging information appearing onscreen change treshold level from 
 DEBUG to INFO in log4j2.xml, like <param name="Threshold" value="INFO"/>


TROUBLESHOOTING
---------------

 Please, resolve following problems:

 General configuration problems:
    1) Use JRE or JDK production (non beta) versions only
    2) Java uses CLASSPATH variable that defines all locations where to look for classes - JAR FILES
       and DIRECTORIES. Add all jar files of "lib" directory to CLASSPATH, not just directory itself
    3) Implementation expects file named "eparaksts.properties" in classpath
    4) Apache Log4j Core Implementation expects file named "log4j2.xml" in classpath
    5) PATH environment variable must contain directory with "PKCS#11" driver
    6) PATH environment variable must contain directory with native part of the IAIK smartcard access library:
       - Microsoft Windows platform: "eParakstsLibraries/lib/native/win32" (pkcs11wrapper.dll)
       - LINUX platform: "eParakstsLibraries/lib/native/linux32" (libpkcs11wrapper.so)
       - MacOSX platform: "eParakstsLibraries/lib/native/macosx" (libpkcs11wrapper.jnilib)

 Problems running samples:
    1) Adjust JAVA_HOME variable in sample.bat
    2) Ensure that you are executing sample.bat from local "samples" directory
    3) If you are providing parameter to sample.bat, please, use right PIN to avoid smartcard being locked
