# IMEX failed to complete: rPGP error: no matching packet found

**URL:** <https://support.delta.chat/t/imex-failed-to-complete-rpgp-error-no-matching-packet-found/3042>\
**Category:** Mutual Help\
**Tags:** android\
**Created:** [April 29, 2024, 10:12pm UTC](https://support.delta.chat/t/imex-failed-to-complete-rpgp-error-no-matching-packet-found/3042 "2024-04-29T22:12:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![foxyseta](https://support.delta.chat/user_avatar/support.delta.chat/foxyseta/32/2402_2.png) [@foxyseta](https://support.delta.chat/u/foxyseta)\
**Post date:** [April 29, 2024, 10:12pm UTC](https://support.delta.chat/t/imex-failed-to-complete-rpgp-error-no-matching-packet-found/3042/1 "2024-04-29T22:12:42Z")

</div>

This happens when I try to import a plaintext private key which is not protected by a passwords.

**Delta Chat version**

(Android)

Delta Chat 1.44.0

**Expected behavior**

My key is imported correctly.

**Actual behavior**

I see the error message `IMEX failed to complete: rPGP error: no matching packet found`

**Steps to reproduce the problem**

1. Settings
2. Advanced
3. Manage Keys
4. Import Secret Keys

---

<div class="post-metadata">

**Author:** ![r10s](https://support.delta.chat/user_avatar/support.delta.chat/r10s/32/1513_2.png) [@r10s](https://support.delta.chat/u/r10s)\
**Post date:** [April 30, 2024, 10:05am UTC](https://support.delta.chat/t/imex-failed-to-complete-rpgp-error-no-matching-packet-found/3042/2 "2024-04-30T10:05:46Z")

</div>

in general, Delta Chat is strict in which keys are supported. eg. OpenPGP packets must match [Autocrypt Level 1: Enabling encryption, avoiding annoyances — Autocrypt 1.1.0 documentation](https://autocrypt.org/level1.html#message-structure), cypher should be Ed25519 plus Cv25519, or RSA

iirc (i am not deep in that topic), this format is used by many todays PGP implementations.

supporting arbitrary, maybe legacy, secret keys is not a primary goal and is always weighted carefully - eg. a larger codebase also means more security risk here. not to speak about implementation and maintenance effort.

some links to - maybe helpful - similar topics:

> [@I am unable to import a key that contains only subkeys.](https://support.delta.chat/t/i-am-unable-to-import-a-key-that-contains-only-subkeys/2986/4):
>
> There is a related issue on GitHub: I closed it as not planned, Delta Chat does not support importing a subkey without primary key.

> [@DeltaChat fails to import keys](https://support.delta.chat/t/deltachat-fails-to-import-keys/2592/5):
>
> Maybe we should export both private and public key to a single file. Selecting a file on Android and similarly sandboxed platforms like Flatpak seems to be much less error-prone than selecting a folder, there are no failures like “granted access to the folder but not the files inside of it” possible. gpg itself does not allow to use both --export and --export-secret-keys though, so having such file with both keys concatenated is probably not common. Maybe it is possible to drop the public key …

> <https://github.com/deltachat/deltachat-core-rust/issues/3499>
>
> \<!--
> This is a bug report tracker. New features are discussed in the forum: htt…ps://support.delta.chat
> 
> Please fill out as much of this form as you can (leaving out stuff that is not applicable is ok).
> \--\>
> 
> \- Device:
> \- iOS version:
> \- Delta Chat version:
> \- Expected behavior:
> \- Actual behavior:
> \- Steps to reproduce the problem:
> \- Screenshots:
> \- Logs:
> 
> \<!--
> Debug logs can be accessed from within the Delta Chat app 
> at "Settings / Advanced / View log / Console" and "Custom variables";
> alternatively, use Xcode.
> 
> Logs may contain private data 
> which shall be removed or anonymised prior to posting.
> \--\>

---

<div class="post-metadata">

**Author:** ![link2xt](https://support.delta.chat/user_avatar/support.delta.chat/link2xt/32/1971_2.png) [@link2xt](https://support.delta.chat/u/link2xt)\
**Post date:** [April 30, 2024, 10:30am UTC](https://support.delta.chat/t/imex-failed-to-complete-rpgp-error-no-matching-packet-found/3042/3 "2024-04-30T10:30:29Z")

</div>

Delta Chat is definitely capable of importing some keys, so without additional information on the type of the key, how did you export it etc. it is not possible to reproduce the bug.

---

<div class="post-metadata">

**Author:** ![foxyseta](https://support.delta.chat/user_avatar/support.delta.chat/foxyseta/32/2402_2.png) [@foxyseta](https://support.delta.chat/u/foxyseta)\
**Post date:** [April 30, 2024, 11:54am UTC](https://support.delta.chat/t/imex-failed-to-complete-rpgp-error-no-matching-packet-found/3042/4 "2024-04-30T11:54:44Z")

</div>

I believe I am currently exporting Ed25519 and Cv25519  
at once

```auto
gpg --armor --export <???>

```

The resulting `.asc` file has a “public key packet”, a “user ID packet”, a “signature packet”, a “public sub key packet”, and a second “signature packet”. I am very much out of my element right now.

---

<div class="post-metadata">

**Author:** ![link2xt](https://support.delta.chat/user_avatar/support.delta.chat/link2xt/32/1971_2.png) [@link2xt](https://support.delta.chat/u/link2xt)\
**Post date:** [May 2, 2024, 11:22am UTC](https://support.delta.chat/t/imex-failed-to-complete-rpgp-error-no-matching-packet-found/3042/5 "2024-05-02T11:22:25Z")

</div>

I think you should use `--export-secret-keys` instead of `--export`. `--export` does not export the secret keys, only the public key.

---

<div class="post-metadata">

**Author:** ![foxyseta](https://support.delta.chat/user_avatar/support.delta.chat/foxyseta/32/2402_2.png) [@foxyseta](https://support.delta.chat/u/foxyseta)\
**Post date:** [May 6, 2024, 7:22pm UTC](https://support.delta.chat/t/imex-failed-to-complete-rpgp-error-no-matching-packet-found/3042/6 "2024-05-06T19:22:03Z")

</div>

Thanks! So my noobiness with gpg was to blame after all.
