Manual

En esta sección encontrarás todas las instrucciones necesarias para utilizar ClickSign.

 

ClickSign for developers

Clicksign has an easy graphic user interface but... ¿What happens if we want integrate the ClickSign signature functions on our own application? If our programing language lets execute a subproccess we have call the class (Java executable binary) that we want execute. We can test it by the system command prompt.

Java and the Class-Path

To execute a class just we have to  use the command java and the class that we want to execute as argument.

java <class name>

Clicksign packages all the class on different files .jar wich there are on the subdirectory lib  of Clicksign installation directory.

And... ¿How knows Java where are the class when I call any of that?

Too easy, we just have to indicate to the command where are the classes, that is know as Class-Path. Assume that the installation directory is the default, to call a class we just have to call:

java -cp "path to the classes and ism.properties" <class name>

You can set a environment variable to have a clean call:

set CSHOME=\Program files\Isigma\ClickSign\
set CLASSPATH=%CSHOME%;%CSHOME%lib\*

Now you have setted the variable CLASSPATH and will be used to the java call:

java -cp "%CLASSPATH%" <class name>

On the following examples you will see the concret functions.

Sign function

If we want to sign a PDF document we have to call the class SignFile:

java -cp "%CLASSPATH%" SignFile Hello.pdf Hello.signed.pdf

Where Hello.pdf is the input PDF file that we want to sign and Hello.signed.pdf is the output PDF file with the signature.

Maybe we want sign another kind of file, by example a .txt:

java -cp "%CLASSPATH%" SignFile Hello.txt Hello.txt.p7d

By this way ClickSign performs a detached signature, or if we want an atached signature we have to execute:

java -cp "%CLASSPATH%" SignFile -a Hello.txt Hello.txt.p7a

Verify function

To verify a signature you have the VerifySignature class:

java -cp "%CLASSPATH%" VerifySignature Hello.signed.pdf
java -cp "%CLASSPATH%" VerifySignature Hello.txt.p7a

On detached signature case you have to indicate the original file and its signature:

java -cp "%CLASSPATH%" VerifySignature Hello.txt Hello.txt.p7d

Timestamp

To make a timestamp for our file call the class GetTimeStamp and indicate the TSA (Time Stamp Authority) URL :

java -cp "%CLASSPATH%" GetTimeStamp \ 
    Hello.txt http://timestamping.edelweb.fr/service/tsp

You will get the file Hello.txt.stamp with the timestamp.

If we want verify the timestamp:

java -cp "%CLASSPATH%" VerifyTimeStamp Hello.txt Hello.txt.stamp

SignLoop

To execute SignLoop instance we have to call:

java -cp "%CLASSPATH%" es.isigma.ism.autosign.AutoSign inbox outbox [ selector ]

inbox and outbox are names of directories on your machine. SignLoop will get all the files to

sign from inbox, will sign and save at outbox.

The optional parameter selector is a regular expresion that will be used to get a certificate between the available. The selected certificate will be the first that matches with the subject Distinguished Name (DN) regular expression. If the regular expresion (last) parameter is not present an interactive mode to select it will be used.

Regular expression samples:

• .*CN=Peter Frampton.* - selects the first certificate that the Common Name (CN) starts with Peter Frampton •

.*C=ES,.* - selects a certificate with the country (C) ES (Spain)

Examples:

java -cp "%CLASSPATH%" es.isigma.ism.autosign.AutoSign \
        C:\inbox C:\outbox ".*CN=Foo.*"

If you doubt about what is the certificate subject DN that you want select you can call SignLoop without parameters and choose one manually. You will get by standard output the selected certificate subject DN, for example:

 

Choosed certificate: CN=Foo Bar, OU=Development, O=Big Co Inc.,L=Canberra, C=AU

Executing SignLoop by this way you can boot the number of different setted instances that you want with different certificates and directories.

WARNING: Do not put the character \ at the end of a path because it will scape the following double quotes and skip the last argument.