Error importing key


Dear daniele_athome,

i use ‘gpg --gen-key’ to create the key ,and run
gpg2 --export [fingerprint] >tigase-kontalk/server-public.key
gpg2 --export-secret-key [fingerprint] >tigase-kontalk/server-private.key
INSERT INTO servers (fingerprint, host, enabled) VALUES('[fingerprint]', '[service_name]', 1);

but log has error

12708 [kontalk:jabber:iq:register Queue Worker 2] INFO  - Creating Kyoto 'FILE_HASH' DB with descriptor '/home/hc/my/kontalk/tigase-kontalk/keyring.kch#bnum=100000#msiz=5242880' to open with modes '[READ_WRITE, CREATE]'
org.bouncycastle.openpgp.PGPException: error importing key
	at org.kontalk.xmppserver.pgp.GnuPGInterface.importKey(
	at org.kontalk.xmppserver.KontalkKeyring.<init>(




you need GnuPG at least version 2.1.14 for Kontalk. Please check your version.

If you already have that, please try to import them back manually using gpg:

gpg2 --import < tigase-kontalk/server-public.key

and check for any errors.


Hi Daniele!

I’ve same error :
> [kontalk:jabber:iq:register Queue Worker 0] INFO - Creating Kyoto ‘FILE_HASH’ DB with descriptor ‘/home/termin/Downloads/tigase-kontalk/keyring.kch#bnum=100000#msiz=5242880’ to open with modes ‘[READ_WRITE, CREATE]’
> org.bouncycastle.openpgp.PGPException: error signing key
> at org.kontalk.xmppserver.pgp.GnuPGInterface.signKey(
> at org.kontalk.xmppserver.KontalkKeyring.signKey(
> at org.kontalk.xmppserver.KontalkIqRegister.signPublicKey(
> at org.kontalk.xmppserver.KontalkIqRegister.process(
> at tigase.server.xmppsession.SessionManager$ProcessorWorkerThread.process(
> at
> 2017-07-14 10:32:02.689 [kontalk:jabber:iq:register Queue Worker 0] KontalkIqRegister.process() WARNING: PGP problem: org.bouncycastle.openpgp.PGPException: error signing key

My gpg ver:
gpg (GnuPG) 2.1.18
libgcrypt 1.7.6-beta

Trying to import the key back using gpg2 --import < tigase-kontalk/server-public.key shows no errors:

gpg: key EA33D20B68FDD6E2: "Temur <>" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1

I’m facing this while trying to varify a valid verification code (123456) with DummyProvider and android client log yelling:

07-14 10:55:07.501 26576-1914/org.kontalk.debug D/SMACK: SENT (5): <iq to='' id='zmO07-11' type='set'><query xmlns='jabber:iq:register'><x xmlns='jabber:x:data' type='submit'><field var='FORM_TYPE' type='hidden'><value></value></field><field label='Validation code' var='code' type='text-single'><value>123456</value></field></x></query></iq>
07-14 10:55:07.656 26576-1915/org.kontalk.debug D/SMACK: RECV (5): <iq id="zmO07-11" xmlns="jabber:client" from="" type="error"><query xmlns="jabber:iq:register"><x xmlns="jabber:x:data" type="submit"><field type="hidden" var="FORM_TYPE"><value></value></field><field type="text-single" var="code" label="Validation code"><value>123456</value></field></x></query><error code="400" type="modify"><bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" xml:lang="en">Invalid public key.</text></error></iq>

Your help is needed, what else could cause that behavior?


(Discussion continued in Error while passing registration)