WDProxKey Token Tool doesn't work in Jammy

Asked by MadhuSoodanan

$ cat /etc/os-release
lsb_release -a
hostnamectl
PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy

I was using NICDSign package with terminal. When double clicking on 'install.sh' it always opens with "Open with Text Editor". There is no Terminal in 'Open with Other Application'. 'Allow executing file as programme' is ticked as default. 'Run as a program' is working. Terminal Version 3.44.0 for GNOME 42 doen't give any information or Gtk:message about the file and it directly asks sudo password without any command. So installation doesn't work properly.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu java-common Edit question
Assignee:
No assignee Edit question
Solved by:
MadhuSoodanan
Solved:
Last query:
Last reply:
Revision history for this message
MadhuSoodanan (mt-madhu) said (last edit ):
#1

Last lines:

jre-x64/lib/amd64/libnet.so
jre-x64/lib/deploy/MixedCodeMainDialogJs.ui
Installing JRE Completed..
Installing NICDSign as Startup Service..
Running NICDSign.....
(Reading database ... 263273 files and directories currently installed.)
Preparing to unpack .../nicdsign-cert_1.9.3_all.deb ...
Unpacking nicdsign-cert (1.9.3) over (1.9.3) ...
Setting up nicdsign-cert (1.9.3) ...

.....................................................................................
No other line appeared in the Terminal. But appeared a pop up window to press 'ok' and 'NICDSign verion' window appeared at the right top when waited a few seconds.

In 18.04 this worked properly. So there is no problem with the package downloaded.

 'NICDSign verion' window appears at the right top corner when reinstalled USB in 22.04.

Revision history for this message
MadhuSoodanan (mt-madhu) said (last edit ):
#2
Revision history for this message
MadhuSoodanan (mt-madhu) said :
#3

while doing with similar package from another site, the following lines also appeared before stopping the process:

chown: cannot access '/home/root/Desktop/NICDSign.desktop': No such file or directory
dpkg: error processing package nicdsign (--install):
 installed nicdsign package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 nicdsign

Revision history for this message
Manfred Hampl (m-hampl) said :
#4

nicdsign seems to be a program from a foreign source outside Ubuntu.
I suggest that you try getting help at the address where you got it.

And generally, for security reason doing a double-click on a shell script in the file explorer window does not execute it, but opens it in the editor. If you want to run that script, you have to give it execute permissions and use the right mouse click and select "run it". the probably even better possibility is opening a terminal window and then starting the script with a command like
sh ./name_of_the:script

Revision history for this message
MadhuSoodanan (mt-madhu) said (last edit ):
#5

This is difficult for me. So I shall wait until the provider suggests any solution if there is no error in GNOME Terminal. It worked in 18.04. So I doubt the package installation process in Jammy. I had tried using nicdsign without install.sh. from another source. But that also didn't work.

Revision history for this message
MadhuSoodanan (mt-madhu) said :
#6

This is the content in install.sh

I want only the proxkey

#!/bin/bash
dskeys=(TRUSTKEY PROXKEY ePass)
token=$(zenity --entry --title "Digital Signature" --entry-text "${dskeys[@]}" --text "Choose your Token")
if [ $(dpkg-query -W -f='${Status}' nicdsign 2>/dev/null | grep -c "ok installed") -eq 1 ]; then
 sudo apt-get purge --force-yes -y nicdsign
 sudo rm -rf $HOME/.config/autostart/DSCService.desktop
 sudo rm -rf $HOME/Desktop/NICDSign.desktop
 sudo rm -rf /opt/nic/NICDSign/jre
fi
if [ $token = "TRUSTKEY" ]; then
 sudo dpkg -i files/wdtokentool-trustkey_1.1.0-1_all.deb
 sudo dpkg -i files/NICDSign1_9_8_Linux.deb
 sudo dpkg -i files/nicdsign-cert_1.9.3_all.deb
 mkdir -p $HOME/Documents
 cp -r /usr/local/DSign/ssl $HOME/Documents/
 mkdir -p $HOME/.config/autostart
 if [ ! -f $HOME/.config/autostart/DSCService.desktop ]; then
  if [ -f /opt/nic/NICDSign/DSCService.desktop ]; then
   cp /opt/nic/NICDSign/DSCService.desktop $HOME/.config/autostart/
  fi
 fi
 (zenity --title "Digital Signature" --info --text "Remove the token and restart Computer")
elif [ $token = "PROXKEY" ]; then
 sudo dpkg -i files/wdtokentool-proxkey_1.1.1-2_all.deb
 sudo dpkg -i files/NICDSign1_9_8_Linux.deb
 sudo dpkg -i files/nicdsign-cert_1.9.3_all.deb
 mkdir -p $HOME/Documents
 cp -r /usr/local/DSign/ssl $HOME/Documents/
 mkdir -p $HOME/.config/autostart
 if [ ! -f $HOME/.config/autostart/DSCService.desktop ]; then
  if [ -f /opt/nic/NICDSign/DSCService.desktop ]; then
   cp /opt/nic/NICDSign/DSCService.desktop $HOME/.config/autostart/
  fi
 fi
 (zenity --title "Digital Signature" --info --text "Remove the token and restart Computer")
elif [ $token = "ePass" ]; then
 if [ $(uname -m) = 'x86_64' ]; then
  sudo dpkg -i files/epass-config_0.1_amd64.deb
  sudo dpkg -i files/NICDSign1_9_8_Linux.deb
  sudo dpkg -i files/nicdsign-cert_1.9.3_all.deb
  sudo /usr/lib/ePass2003-Linux-x64/config/config.sh
  cp -r /usr/lib/ePass2003-Linux-x64/config-new $HOME/
  mv $HOME/config-new $HOME/ePass-config-new
 else
  sudo dpkg -i files/epass-config_0.1_i386.deb
  sudo dpkg -i files/NICDSign1_9_8_Linux.deb
  sudo dpkg -i files/nicdsign-cert_1.9.3_all.deb
  sudo /usr/lib/ePass2003-Linux-i386/config/config.sh
  cp -r /usr/lib/ePass2003-Linux-i386/config-new $HOME/
  mv $HOME/config-new $HOME/ePass-config-new
 fi
 mkdir -p $HOME/Documents
 cp -r /usr/local/DSign/ssl $HOME/Documents/
 mkdir -p $HOME/.config/autostart
 if [ ! -f $HOME/.config/autostart/DSCService.desktop ]; then
  if [ -f /opt/nic/NICDSign/DSCService.desktop ]; then
   cp /opt/nic/NICDSign/DSCService.desktop $HOME/.config/autostart/
  fi
 fi
 (zenity --title "Digital Signature" --info --text "Remove the token and restart Computer")
else
 (zenity --title "Digital Signature" --error --text "No valid token selected")
fi

Revision history for this message
Manfred Hampl (m-hampl) said :
#7

I do not understand:
Which kind of information do you expect in the terminal?

The output in comment #1 does not show an error. What else do you need?

Revision history for this message
MadhuSoodanan (mt-madhu) said (last edit ):
#8

#6 was not about the command. It was about the content in install.sh

If there is any slight error in that file that might be the reason for the defect in the installation. I don't know the command for running .sh file

I don't know whether sh./install is the command you intended. Name of the script and the filename, are they the same?

Revision history for this message
Manfred Hampl (m-hampl) said :
#9

I already wrote it in comment #4:

If you want to execute a shell scrip, the best way is doing this from a terminal window.

Open a terminal window (e.g. by simultaneously pressing ctrl-alt-t)

Change to the directory where the shell script is located (if it is not in your home directory), e.g.

cd Downloads

and the execute the script

sh ./install.sh

(Note the space character in third position).

I would have expected that there is some kind of "How to install" instruction at the source where you got that file, that tells you what exactly has to be done. What I wrote above is just a guess that works in many similar cases, but not all of them.

And yes, "filename", "name of the file" and "name of the shell script", these words describe the same, in your case "install.sh"

Revision history for this message
MadhuSoodanan (mt-madhu) said :
#10

USB token Authentication 01

User PIN Status

User PIN Modified

Internal CSP Name

USB token file structure integrity

All these 5 shows ......... Failed to retrieve configuration.

Revision history for this message
MadhuSoodanan (mt-madhu) said (last edit ):
#11

Before you posted #10 I tried using

./install.sh
sh install.sh
bash install.sh

2 of these commands gave the same result.

Revision history for this message
MadhuSoodanan (mt-madhu) said :
#12

sh ./install.sh
./install.sh: 2: Syntax error: "(" unexpected

Revision history for this message
Manfred Hampl (m-hampl) said :
#13

I have no idea what this program should do, and so I do not know what to do with that error.
You have to ask the provider of that piece of software, and that is not Ubuntu.

Revision history for this message
MadhuSoodanan (mt-madhu) said (last edit ):
#14

About #11

I meant , in the case of

./install.sh and

bash install.sh

Terminal worked; but didn't get a good end result. Both of the asked for selecting token and at last asked to remove the USB and restart. But not as given in the manual. May be because of the version. The installation is almost over. It is running. But the problem is that it couldn't identify me in the token even after the installation. I mean my name is not in the token (as in the earlier version) even after I plugged the USB. Sorry, If I confused you. When I used the 18.04 all the other data was almost the same. The differences are mentioned in #10. Don't know whether it is because of the difference in the token tool package or in the certificate storing path or something else.

Another problem that may occur is with the Java Version. Java 8 is the required one.

The certificate and software was for providing Government services. It is free.

java ~version
Error: Could not find or load main class ~version
Caused by: java.lang.ClassNotFoundException: ~version

But even when it gave 'a result' it didn't work properly.

Revision history for this message
MadhuSoodanan (mt-madhu) said :
#15
Revision history for this message
Manfred Hampl (m-hampl) said :
#16

The correct command for verifying java is not
java ~version
(with a tilde) but
java -version
(with a minus).

You cannot expect that anybody helping here has got experience with that local government application.
I assume that you know https://rr.kerala.gov.in/Help/nicdsigner-linux-help.pdf
On the page https://rr.kerala.gov.in/signer_integration_help.phpthere is a link "Contact us". Maybe you can get help there.

Revision history for this message
MadhuSoodanan (mt-madhu) said (last edit ):
#17

Yes, of course. It was a typo. I had done it previously correctly and got the correct output. Now I could found it.

                                                        $ java -version
openjdk version "11.0.17" 2022-10-18
OpenJDK Runtime Environment (build 11.0.17+8-post-Ubuntu-1ubuntu222.04)
OpenJDK 64-Bit Server VM (build 11.0.17+8-post-Ubuntu-1ubuntu222.04, mixed mode, sharing)

In 18,04 it it was openjdk version 1.8.0-191. I think that system is working with this version ( openjdk version 1.8.0-191)

If so do I need to change the default version to this? I don't know how to make it default without removing 11.0.17.

I had read it before installing..............but it is only now I noticed the line ..........."Proceed installation, if java -version shows to be 1.8, otherwise install and proceed" :) Thanks.

That means I can't use it if it is 11.0.17 ?

I didn't try using the package in the second link. I think that one also will be the same.

Revision history for this message
MadhuSoodanan (mt-madhu) said :
#18

I could find the packages in jvm folder

/usr/lib/jvm/java-8-openjdk-amd64
/usr/lib/jvm/java-1.8.0-openjdk-amd64

I don't know whether I should make this one default or working.

Revision history for this message
MadhuSoodanan (mt-madhu) said (last edit ):
#19

If so,

If I did ... sudo update-alternatives --config java ... will it work with the higher version also?

Do I need to make any other changes?

Revision history for this message
MadhuSoodanan (mt-madhu) said (last edit ):
#20

sudo update-alternatives --config java

*0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto mode
  1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual mode
  2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode

Press <enter> to keep the current choice[*], or type selection number:

Now the asterisk is against '0'
If I entered 2, will it use the higher option also?

Revision history for this message
MadhuSoodanan (mt-madhu) said (last edit ):
#21

I tried using Java 8 after got the output

java -version
openjdk version "1.8.0_352"
OpenJDK Runtime Environment (build 1.8.0_352-8u352-ga-1~22.04-b08)
OpenJDK 64-Bit Server VM (build 25.352-b08, mixed mode)

And after that I followed as given in a trouble shoot tutorial.

https://docs.ksitmalappuzha.in/4.software-issues/nicdsign-issues

Another thing is, after changed the java version to Java 8 DiagnosticTool didn't work.

Revision history for this message
MadhuSoodanan (mt-madhu) said (last edit ):
#22

When I tried the last section in the link I got the output

sudo mkdir /home/user/.config/autostart
[sudo] password for
mkdir: cannot create directory ‘/home/user/.config/autostart’: No such file or directory

Up to this, I tried to solve the problem at my own risk ......If I can, I wish to proceed if I get some help.

Revision history for this message
Manfred Hampl (m-hampl) said :
#23

Who tells you to execute the command "sudo mkdir /home/user/.config/autostart"?
That's nonsense and valid only when your username is "user".
In your case, when you username is "madhu" (at least that is what I suppose), the command must be
sudo mkdir /home/madhu/.config/autostart

I suggest that you contact the author of that instruction to tell him about that error.

Revision history for this message
MadhuSoodanan (mt-madhu) said (last edit ):
#24

It says in the last section of the tutorial in https://docs.ksitmalappuzha.in/4.software-issues/nicdsign-issues

Thanks a lot. I shall try. I also didn't notice the difference. I didn't doubt since it is seen in two places in that document. So I just pasted it in the terminal...and got into trouble.

Revision history for this message
MadhuSoodanan (mt-madhu) said :
#25

Since the issue is 98% same as mentioned in the tutorial I am still following that tutorial as per your instructions. I am trying to shorten this thread. That is why I am doing before you post your instructions. I got even the window at the right top corner that shows it is running (when plugged in the token). But..... :(

(When followed the tutorial ) Since the pasted icon disappears after reboot, I created even an empty icon using touch command. An empty directory appeared on the desktop.

Output

touch NICDSign.desktop
~/Desktop$ sudo mkdir /home/madhu/.config/autostart
[sudo] password for madhu:
mkdir: cannot create directory ‘/home/madhu/.config/autostart’: File exists
~/Desktop$

Revision history for this message
MadhuSoodanan (mt-madhu) said (last edit ):
#26

I tried this also:

Copied the content in NICDSign.desktop with a lock sign in 18.04 (which is working perfectly) and pasted it on my Jammy desktop.

the content in it was ........

[Desktop Entry]
Type=Application
Exec=sh /opt/nic/NICDSign/NICDSignRestart.sh
Hidden=false
NoDisplay=false
Icon=/opt/nic/NICDSign/logo.png
Name[en_IN]=NICDSign
Name=NICDSign
Comment[en_IN]=NICDSign Manual Startup
Comment=NICDSign Manual Startup

Appeared the icon ..... rebooted ..... but still not working. The two applications ProxKey Digonostic Tool and ProxKey Token Tool is working since I went back to Java 11. (from my searching I realised *0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto mode also is working.

NSDSIgn.deskto Icon is still there without any response to my Token Tool :(

Revision history for this message
MadhuSoodanan (mt-madhu) said (last edit ):
#27

The provider didn't give correct information about the changes. Their advice was to return to the older version-18.04. But I wish to stick on to Jammy.

Revision history for this message
MadhuSoodanan (mt-madhu) said (last edit ):
#28

Manfred Hampl, thanks a lot for your help. You taught me some important things. At last I got it worked in Jammy. The problem was with the version.

Revision history for this message
MadhuSoodanan (mt-madhu) said (last edit ):
#29