# Problems importing PGP keys when using EC type keys

**URL:** <https://community.ciphermail.com/t/problems-importing-pgp-keys-when-using-ec-type-keys/708>\
**Category:** Gateway\
**Created:** [July 10, 2020, 3:41pm UTC](https://community.ciphermail.com/t/problems-importing-pgp-keys-when-using-ec-type-keys/708 "2020-07-10T15:41:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jorge\_Gonzalez](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@Jorge\_Gonzalez](https://community.ciphermail.com/u/Jorge_Gonzalez)\
**Post date:** [July 10, 2020, 3:41pm UTC](https://community.ciphermail.com/t/problems-importing-pgp-keys-when-using-ec-type-keys/708/1 "2020-07-10T15:41:25Z")

</div>

Good morning,

I'm having some trouble when importing public PGP keys in Ciphermail  
(Ubuntu 16) which have been created with EC private keys. These keys  
have started to be created by default by Enigmail (PGP extension for  
Thunderbird) since some time ago, and for the moment we are instructing  
our partners to make sure they select RSA type keys instead of the  
default EC when creating their keys.

The error log found in the djigzo log is as follows:

10 Jul 2020 11:24:54 | WARN Error downloading key with key ID  
2E78B913BC3C849635F38F357CACB7AA3BEC5AF2. Error message : IOException:  
unknown PGP public key algorithm encountered, Class: class  
java.io.IOException  
(mitm.application.djigzo.ws.impl.KeyServerClientWSImpl)  
[defaultEventExecutorGroup-4-6]

By downloading Ciphermail source and tracing a bit, it seems that Bouncy  
Castle libraries are used to manage PGP keys, and it also seems that EC  
PGP keys are not supported until version 1.60 (Ciphermail ships with BC  
1.58).

I have manually substituted the JARs for Bouncy Castle in  
/usr/share/djigzo/lib and then restarted the service. Importing EC PGP  
keys then worked flawlessly, no errors in log and I could see them on  
the web management app.

But then I tried to send a test email to one of the addresses for which  
only EC keys existed in Ciphermail, and it did NOT work, so I put bak  
the original vesions of the BC libraries, and everything went back to  
normal. I had to delete the EC keys from Ciphermail, since they were now  
marked as invalid.

My question to Ciphermail developers: are there any plans in the roadmap  
to update the Bouncy Castle libraries so that EC PGP keys are supported?

Thanks

Jorge

[attachment.htm](https://community.ciphermail.com/uploads/short-url/elgHfmou5mKAKrgorFN5ldDj34n.htm) (2.39 KB)

> **···**
>
> --  
> \*Jorge Gonzalez Villalonga\*  
> Systems Engineer  
> The International Consortium of Investigative Journalists  
> \<[https://www.icij.org](https://www.icij.org)\>  
> 1710 Rhode Island Ave NW, 11th floor | Washington DC 20036 | United States  
> Phone: +34 672 173 200 (Madrid, Spain)

---

<div class="post-metadata">

**Author:** ![martijn](https://dub1.discourse-cdn.com/flex017/user_avatar/community.ciphermail.com/martijn/32/127_2.png) [@martijn](https://community.ciphermail.com/u/martijn)\
**Post date:** [July 10, 2020, 3:50pm UTC](https://community.ciphermail.com/t/problems-importing-pgp-keys-when-using-ec-type-keys/708/2 "2020-07-10T15:50:32Z")

</div>

Hi Jorge,

You are right that EC support is long overdue ☹ The main reason is  
that Bouncycastle did not have support for EC keys. The last time I  
checked it could import EC keys but they could not be used with PGP  
because of some missing functionality. I will look at this again to see  
whether we can support it.

Kind regards,

Martijn Brinkers

> **···**
>
> On Fri, 2020-07-10 at 17:41 +0200, Jorge Gonzalez via Users wrote:
> 
> > Good morning,  
> > I'm having some trouble when importing public PGP keys in Ciphermail  
> > (Ubuntu 16) which have been created with EC private keys. These keys  
> > have started to be created by default by Enigmail (PGP extension for  
> > Thunderbird) since some time ago, and for the moment we are  
> > instructing our partners to make sure they select RSA type keys  
> > instead of the default EC when creating their keys.  
> > The error log found in the djigzo log is as follows:  
> > 10 Jul 2020 11:24:54 | WARN Error downloading key with key ID  
> > 2E78B913BC3C849635F38F357CACB7AA3BEC5AF2. Error message :  
> > IOException: unknown PGP public key algorithm encountered, Class:  
> > class java.io.IOException  
> > (mitm.application.djigzo.ws.impl.KeyServerClientWSImpl)  
> > [defaultEventExecutorGroup-4-6]  
> > By downloading Ciphermail source and tracing a bit, it seems that  
> > Bouncy Castle libraries are used to manage PGP keys, and it also  
> > seems that EC PGP keys are not supported until version 1.60  
> > (Ciphermail ships with BC 1.58).  
> > I have manually substituted the JARs for Bouncy Castle in  
> > /usr/share/djigzo/lib and then restarted the service. Importing EC  
> > PGP keys then worked flawlessly, no errors in log and I could see  
> > them on the web management app.  
> > But then I tried to send a test email to one of the addresses for  
> > which only EC keys existed in Ciphermail, and it did NOT work, so I  
> > put bak the original vesions of the BC libraries, and everything went  
> > back to normal. I had to delete the EC keys from Ciphermail, since  
> > they were now marked as invalid.  
> > My question to Ciphermail developers: are there any plans in the  
> > roadmap to update the Bouncy Castle libraries so that EC PGP keys are  
> > supported?
> 
> --  
> CipherMail email encryption  
> Email encryption with support for S/MIME,  
> OpenPGP, PDF Messenger and Webmail Messenger
> 
> > --  
> > Jorge Gonzalez Villalonga  
> > Systems Engineer  
> > The International Consortium of Investigative Journalists  
> > 1710 Rhode Island Ave NW, 11th floor | Washington DC 20036 | United  
> > States  
> > Phone: +34 672 173 200 (Madrid, Spain)  
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > Users mailing list -- users(a)lists.ciphermail.com  
> > To unsubscribe send an email to users-leave(a)lists.ciphermail.com

---

<div class="post-metadata">

**Author:** ![Jorge\_Gonzalez](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@Jorge\_Gonzalez](https://community.ciphermail.com/u/Jorge_Gonzalez)\
**Post date:** [July 10, 2020, 5:46pm UTC](https://community.ciphermail.com/t/problems-importing-pgp-keys-when-using-ec-type-keys/708/3 "2020-07-10T17:46:59Z")

</div>

Thanks for the quick response, Martijn, I look forward to your findings.

Please do not hesitate to contact me if you need any help for testing,  
etc. I'll be glad to help.

Thanks

Jorge

\*Jorge Gonzalez Villalonga\*  
Systems Engineer  
\*The International Consortium of Investigative Journalists\*  
\<[https://www.icij.org](https://www.icij.org)\>  
1710 Rhode Island Ave NW, 11th floor | Washington DC 20036 | United States  
Phone: +34 672 173 200 (Madrid, Spain)

[attachment.htm](https://community.ciphermail.com/uploads/short-url/6C41rC9Tng30JA8Z1ZDQVfZBq9w.htm) (3.17 KB)

> **···**
>
> El 10/7/20 a las 17:50, Martijn Brinkers escribió:
> 
> > On Fri, 2020-07-10 at 17:41 +0200, Jorge Gonzalez via Users wrote:
> > 
> > > Good morning,  
> > > I'm having some trouble when importing public PGP keys in Ciphermail  
> > > (Ubuntu 16) which have been created with EC private keys. These keys  
> > > have started to be created by default by Enigmail (PGP extension for  
> > > Thunderbird) since some time ago, and for the moment we are  
> > > instructing our partners to make sure they select RSA type keys  
> > > instead of the default EC when creating their keys.  
> > > The error log found in the djigzo log is as follows:  
> > > 10 Jul 2020 11:24:54 | WARN Error downloading key with key ID  
> > > 2E78B913BC3C849635F38F357CACB7AA3BEC5AF2. Error message :  
> > > IOException: unknown PGP public key algorithm encountered, Class:  
> > > class java.io.IOException  
> > > (mitm.application.djigzo.ws.impl.KeyServerClientWSImpl)  
> > > [defaultEventExecutorGroup-4-6]  
> > > By downloading Ciphermail source and tracing a bit, it seems that  
> > > Bouncy Castle libraries are used to manage PGP keys, and it also  
> > > seems that EC PGP keys are not supported until version 1.60  
> > > (Ciphermail ships with BC 1.58).  
> > > I have manually substituted the JARs for Bouncy Castle in  
> > > /usr/share/djigzo/lib and then restarted the service. Importing EC  
> > > PGP keys then worked flawlessly, no errors in log and I could see  
> > > them on the web management app.  
> > > But then I tried to send a test email to one of the addresses for  
> > > which only EC keys existed in Ciphermail, and it did NOT work, so I  
> > > put bak the original vesions of the BC libraries, and everything went  
> > > back to normal. I had to delete the EC keys from Ciphermail, since  
> > > they were now marked as invalid.  
> > > My question to Ciphermail developers: are there any plans in the  
> > > roadmap to update the Bouncy Castle libraries so that EC PGP keys are  
> > > supported?
> > 
> > Hi Jorge,
> > 
> > You are right that EC support is long overdue ☹ The main reason is  
> > that Bouncycastle did not have support for EC keys. The last time I  
> > checked it could import EC keys but they could not be used with PGP  
> > because of some missing functionality. I will look at this again to see  
> > whether we can support it.
> > 
> > Kind regards,
> > 
> > Martijn Brinkers
