Autocrypt Setup Message Transfer FormatΒΆ

This document describes a format recommendation for the Autocrypt Setup Message payload. The Autocrypt Setup Message payload is an attachment in a mail client that can be handled automatically by Autocrypt clients, but also strives for usability when saved as a file in agnostic clients.

This goal is achieved by two mechanisms:

  • The MIME part MUST have a Content-Disposition of “attachment”. Its filename, as specified in Content-Type and Content-Disposition header parameters, MUST have an extension of ”.html”.
  • The file MUST be formatted as proper HTML. It SHOULD give a human-readable description at the beginning, and MUST include the encrypted key as a contiguous block of ASCII-armored data, with no indentation or HTML tags inside. This block SHOULD reside inside a <pre> block for readability.

With this technique, the way the attachment is handled when saved to disk by the user is independent from its handling by clients aware of its Content-Type. HTML as the actual file content is chosen as a universal and familiar format. It can be opened in a browser, allowing the file to provide a description of itself “on double-click” on almost any system.

Since the file contains an easy to locate block of ASCII-armored data, it can still easily be processed by OpenPGP tools. In particular, GnuPG ignores the header before the armored data starts, so a regular call to gpg --decrypt still works.

An exemplary Autocrypt Setup Message’s MIME part would look like the text below. This Autocrypt Setup Message can be unlocked with the Setup Code D9VN-RD7A-7T3B-BWG7-LEPY-3NYT.

Content-Type: application/pgp-key-backup; name="Autocrypt-Key for name-at-example.org.html"
Content-Description: OpenPGP Digital Signature
Content-Disposition: attachment; filename="Autocrypt-Key for name-at-example.org.html"

<html><body><h1>Autocrypt Key for <tt>example.org</tt></h1><p>

This is an Autocrypt Key file. When imported into an Autocrypt capable E-Mail
client with its backup code, it can be used to read encrypted E-Mail sent to
<tt>name@example.org</tt>.

</p><pre>
-----BEGIN PGP MESSAGE-----
Passphrase-Format: alphanumeric

jA0EBwMC2FohQ7r/Yovm0usBJ2ZwYc4COaY3SpDWXKsZ6SQ8A2nDq8+PeN2mP7EK
PtzXRiCcYh6Q+OqmYKjX1t48HhXj962hM6KGKIHsYFGVViCJTOezTp2w27aLJDjN
fxJHm9d7ESuYE+HjlEx5T6TbR+R5/0jL25i62jyHAAruld6uIgH8mp8gPUM0LL7r
W6vX1C04/9cmVHlFMPErj8pEm+H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1w
9wb+xO9XF03Z6gXrKOup60Fu8nCl49Wt8pBo092JXC6hxoct7VbbNEV4C5VhcYfN
mAvrGKCdFuGyQDVvbqnHjP5unwnhfvOqiILx1GqRRzhOBmw49w4hbnPaKBQ6oL1X
/AjXeelaNrntohrGNlh2DvZ5+dUHqKFicaSD8zda+/9RISWKlENknJXHy/ZK9V6C
xUbOVydoyTLaP9bQScqv4WBqVcw5k8v4i+I=
=k6Rc
-----END PGP MESSAGE-----
</pre><hr><i><a href="http://example.org/">Generated by Autocrypt-capable Client</a>.</i></body></html>