Coder Social home page Coder Social logo

etax-xades's Introduction

Xades - Ready to use (Local)

This repository is Xades signature sign and verification sample code for Thailand etax invoice

Feature support

  • Sign multiple file with in target directory
  • Archive all targeted directory
  • Support prefix signed file

Require

  • Java JRE8 (java 8 for higher)
  • Windows OS (if not, can be any that support JAVA but no execution provided yet.)

How to use

  1. Change 3 variables value in run.bat file
set JAVA_TARGET=C:\Program Files\Java\jdk1.8.0_111\bin\java.exe
set CONFIG_FILE="ABSOLUTE PATH to config file"
set JAR_TARGET=xades-ready-to-use-jar-with-dependencies.jar
...
  1. Update value in configuration file.
  2. double-click run.bat

Configuration file

Property Meaning Example
SIGN_INPUT_PATH Input directory C:\temp\in
SIGN_OUTPUT_PATH Output directory C:\temp\out
SIGN_ARCHIVE_PATH Archive directory (leave it blank for you don't need to archive) C:\temp\archive
SIGNED_PREFIX Prefix name for signed filename (leave it blank for you don't want filename change) signed-
PK_TYPE Cryptography Standards selection PKCS12
PKCS11
#PKCS11 PARAMETER
PKCS11_LIB_PATH Target PKCS11 C:\windows\system32\eTPKCS11.dll
/usr/local/lib/libeTPkcs11.dylib
/usr/lib/opensc-pkcs11.so
PKCS11_PROVIDER_NAME Provider's name eToken
PKCS11_SLOT_ID Slot of targeted certificate 0
PKCS11_PASSWORD password for targeted certificate P@ssw0rd
PKCS11_PIN pin for targeted certificate 12345678
Note: you can find Provider name and slot ID in Driver's application or programatic way at https://docs.oracle.com/javase/8/docs/technotes/guides/security/p11guide.html#TroubleShoot
#PKCS12 PARAMETER
PKCS12_PATH Location of targeted certificate ./key.p12
PKCS12_PASSWORD password for targeted certificate password
#XAdES-BES VERIFICATION PARAMETER - this section is for receiver, unnecessary to focusing.
...

to debug PKCS11 lib:

keytool -list -v -storetype pkcs11 -providerClass sun.security.pkcs11.SunPKCS11 -providerArg <PATH_TO_CONFIG_FILE>\pkcs11.cfg

or

keytool -keystore NONE -storetype PKCS11 -list

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.