2

I'm trying to build a tizen web application for a Samsung Active 2 smartwatch from CLI (Arch linux) and I keep getting this error:

[ERROR] Main.java(195) - org.tizen.common.sign.exception.CertificationException: Invaild password

I've followed this manual: Tizen CLI manual

The command I use to build the package is:

tizen package -t wgt -s CertificateName  -- .

Where CertificateName is the name of my already existing certificate that I created using also the CLI with the command:

tizen certificate -a CertificateName -p password -n Name -e fake@email.com

After generating the certificate I've added to the security profiles using the command:

tizen security-profiles add -n author -a /home/user/tizen-studio-data/keystore/author/author.p12 -p password

And after it, I've added the Trust Anchor to the project with the command:

tizen trust-anchor set -c /home/user/tizen-studio-data/keystore/author/author.p12 -s true -- projectfolder

How can I fix the Invalid Password error? Thanks!

2 Answers2

6

When you call tizen package, the app checks the certificates' entries of the default profile.xml file that you set. It should look like this:

<profileitem ca="<tizen>/tools/certificate-generator/certificates/developer/tizen-developer-ca.cer" distributor="0" key="<tizen-data>/keystore/author/<cert>.p12" password="<tizen-data>/keystore/author/<cert>.pwd" rootca=""/>

<profileitem ca="<tizen>/tools/certificate-generator/certificates/distributor/tizen-distributor-ca.cer" distributor="1" key="<tizen>/tools/certificate-generator/certificates/distributor/tizen-distributor-signer.p12" password="<tizen-data>/tools/certificate-generator/certificates/distributor/tizen-distributor-signer.pwd" rootca=""/>

Actually, the passwords aren't stored in the *.pwd files but in the Login keyring of gnome-keyring. In order to retrieve the passwords previously stored by calling tizen security-profiles add, tizen package calls:

<tizen>/tools/certificate-encryptor/secret-tool lookup --label=tizen-studio.

You'll see by using the command above that you'll have an error giving more information than tizan package. In your case, gnome-keyring may not be installed or the Login keyring may not be correctly initialized.

SOLUTION #1

To resolve the issue the simplest thing to do is to install/reinstall the gnome-keyring package and reboot (or restart gnome-keyring-daemon):

pacman -S gnome-keyring
reboot

This should add the Login keyring and if it doesn't you can add it manually using seahorse or echo <PASSWORD> | gnome-keyring-daemon --unlock

Finally, re-add your profile with tizen security-profiles add. You can see the Tizen blog post for remote/docker configuration.

SOLUTION #2

If you don't want to bother with gnome-keyring you can try to add the passwords directly in the profiles.xml file as shown on the Tizen forum and written below:

<profileitem ca="<tizen>/tools/certificate-generator/certificates/developer/tizen-developer-ca.cer" distributor="0" key="<tizen-data>/keystore/author/<cert>.p12" password="<strong_password>" rootca=""/>

<profileitem ca="<tizen>/tools/certificate-generator/certificates/distributor/tizen-distributor-ca.cer" distributor="1" key="<tizen>/tools/certificate-generator/certificates/distributor/tizen-distributor-signer.p12" password="tizenpkcs12passfordsigner" rootca=""/>
CravateRouge
  • 130
  • 7
  • Thank you. Solution #2 worked for me. However, I tried solution #1 and could not get it working. I am running on a Windows 11 / WSL 2 environment with Ubuntu and Tizen Studio installed on it. This is fairly new kind of thing being able to run Linux GUI apps on Windows. Any advice on what alternate steps I could take somewhere along the lines of solution #1? – Joshua Dannemann Feb 01 '22 at 19:42
  • The "secret-tool" suggestion was most helpful to me. It pointed out that the real underlying error was a missing binary. – Zach May 03 '23 at 22:25
0

The solution that I found for this was to create a new certificate, and make sure that the password only contains lowercase letters and numbers

I was previously getting this error when my password contained non-alphanumeric symbols, but am not getting the error with the new password

Steve
  • 437
  • 6
  • 14