<?xml version="1.0" encoding="UTF-8"?>
  <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
  <!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.14 (Ruby 3.1.2) -->


<!DOCTYPE rfc  [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">

]>


<rfc ipr="trust200902" docName="draft-dkg-openpgp-external-secrets-00" category="info" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true">
  <front>
    <title>OpenPGP External Secret Keys</title>

    <author initials="D. K." surname="Gillmor" fullname="Daniel Kahn Gillmor">
      <organization abbrev="ACLU">American Civil Liberties Union</organization>
      <address>
        <postal>
          <street>125 Broad St.</street>
          <city>New York, NY</city>
          <code>10004</code>
          <country>USA</country>
        </postal>
        <email>dkg@fifthhorseman.net</email>
      </address>
    </author>

    <date year="2024" month="August" day="02"/>

    <area>int</area>
    <workgroup>openpgp</workgroup>
    <keyword>Internet-Draft</keyword>

    <abstract>


<?line 68?>

<t>This document defines a standard wire format for indicating that the secret component of an OpenPGP asymmetric key is stored externally, for example on a hardware device or other comparable subsystem.</t>



    </abstract>

    <note title="About This Document" removeInRFC="true">
      <t>
        The latest revision of this draft can be found at <eref target="https://dkg.gitlab.io/openpgp-external-secrets/"/>.
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-dkg-openpgp-external-secrets/"/>.
      </t>
      <t>
        Discussion of this document takes place on the
        OpenPGP Working Group mailing list (<eref target="mailto:openpgp@ietf.org"/>),
        which is archived at <eref target="https://mailarchive.ietf.org/arch/browse/openpgp/"/>.
        Subscribe at <eref target="https://www.ietf.org/mailman/listinfo/openpgp/"/>.
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://gitlab.com/dkg/openpgp-external-secrets/"/>.</t>
    </note>


  </front>

  <middle>


<?line 72?>

<section anchor="introduction"><name>Introduction</name>

<t>Some OpenPGP secret key material is held by hardware devices that permit the user to operate the secret key without divulging it explicitly.
For example, the <xref target="OPENPGP-SMARTCARD"/> specification is intended specifically for this use.
It may also possible for OpenPGP implementations to use external secret key material via standard platform library interfaces like <xref target="TPM"/>.</t>

<t>An OpenPGP Secret Key Packet (see <xref section="5.5.3" sectionFormat="of" target="RFC9580"/>) is typically used as part of a Transferable Secret Key (<xref section="10.2" sectionFormat="of" target="RFC9580"/>) for interoperability between OpenPGP implementations.
An implementation that uses an external secret key needs a standardized way to indicate to another implementation specific secret key material has been delegated to some external mechanism, like a hardware device.</t>

<t>This document defines a simple mechanism for indicating that a secret key has been delegated to an external mechanism by allocating a codepoint in the "Secret Key Encryption (S2K Usage Octet)" registry (see <xref section="3.7.2.1" sectionFormat="of" target="RFC9580"/>).</t>

<t>This document makes no attempt to specify how an OpenPGP implementation discovers, enumerates, or operates external secret keys, other than to recommend that the hardware or comparable external subsystem should be identifiable by the secret key's corresponding public key material.</t>

<section anchor="requirements-language"><name>Requirements Language</name>

<t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>

<?line -18?>

</section>
<section anchor="terminology"><name>Terminology</name>

<t>"Secret key" refers to a single cryptographic object, for example the "56 octets of the native secret key" of X448, as described in <xref section="5.5.5.8" sectionFormat="of" target="RFC9580"/>.</t>

<t>"Public key" likewise refers to a single cryptographic object, for example the "56 octets of the native public key" of X448, as above.</t>

<t>"OpenPGP certificate" or just "certificate" refers to an OpenPGP Transferable Public Key (see <xref section="10.1" sectionFormat="of" target="RFC9580"/>).</t>

<t>"External" refers to any cryptographic device or subsystem capable of performing an asymmetric secret key operation using an embedded secret key without divulging the secret to the user.
For discoverability, the external mechanism is also expected to be able to produce the public key corresponding to the embedded secret key.</t>

<t>While this document talks about "external" in the abstract as referring to a cryptographic device embedding a single secret key, most actual hardware devices or other cryptographic subsystems will embed and enable the use of multiple secret keys (see <xref target="multiple-key-hardware"/>).</t>

<t>This document uses the term "authorization" to mean any step, such as providing a PIN, password, proof of biometric identity, button-pushing, etc, that the external subsystem may require for an action.</t>

</section>
</section>
<section anchor="spec"><name>Externally-backed Secret Key Material</name>

<t>An OpenPGP Secret Key packet (<xref section="5.5.3" sectionFormat="of" target="RFC9580"/>) indicates that the secret key material is stored in an cryptographic subsystem that is identifiable by public key parameters in the following way.</t>

<t>The S2K usage octet is set to TBD (252?), known in shorthand as <spanx style="verb">External</spanx>.
A producing implementation <bcp14>MUST NOT</bcp14> include any trailing data in the rest of such a Secret Key packet.
A consuming implementation <bcp14>MUST</bcp14> ignore any trailing data in such a Secret Key packet.</t>

</section>
<section anchor="security-considerations"><name>Security Considerations</name>

<t>External or hardware-backed secret keys promise several distinct security advantages to the user:</t>

<t><list style="symbols">
  <t>Often, the secret key cannot be extracted from the device, so "kleptography" (the stealing of secret key material) is harder to perform.</t>
  <t>Some hardware can be moved between machines, enabling secret key portability without expanding the kleptographic attack surface.</t>
  <t>Some hardware devices offer auditability controls in the form of rate-limiting, user-visible authorization steps (e.g., button-presses or biometric sensors), or tamper-resistant usage counters.
Malicious use of a secret key on such a device should be harder, or at least more evident.</t>
  <t>Some hardware security devices can attest that key material has been generated on-card, thereby signaling that - barring a successful attack on the hardware - no other copy of the private key material exists.
Such mechanisms signal that the key holder did not have a chance to mishandle (e.g.: accidentally disclose) the private key material.</t>
</list></t>

<t>However, none of these purported advantages are without caveats.</t>

<t>The hardware itself might actually not resist secret key exfiltration as expected.
For example, isolated hardware devices are sometimes easier to attack physically, via temperature or voltage fluctuations (see <xref target="VOLTAGE-GLITCHING"/> and <xref target="SMART-CARD-FAULTS"/>).</t>

<t>In some cases, dedicated cryptographic hardware that generates a secret key internally may have significant flaws (see <xref target="ROCA"/>).</t>

<t>Furthermore, the most sensitive material in the case of decryption is often the cleartext itself, not the secret key material.
If the host computer itself is potentially compromised, then kleptographic exfiltration of the secret key material itself is only a small risk.
For example, the OpenPGP symmetric session key itself could be exfiltrated, permitting access to the cleartext to anyone without access to the secret key material.</t>

<t>Portability brings with it other risks, including the possibility of abuse by the host software on any of the devices to which the hardware is connected.</t>

<t>Rate-limiting, user-visible authorization steps, and any other form of auditability also suffer from risks related to compromised host operating systems.
Few hardware devices are capable of revealing to the user what operations specifically were performed by the device, so even if the user deliberately uses the device to, say, sign an object, the user depends on the host software to feed the correct object to the device's signing capability.</t>

</section>
<section anchor="usability-considerations"><name>Usability Considerations</name>

<t>External secret keys present specific usability challenges for integration with OpenPGP.</t>

<section anchor="some-hardware-might-be-unavailable-to-some-implementations"><name>Some Hardware Might Be Unavailable To Some Implementations</name>

<t>This specification gives no hints about how to find the hardware device, and presumes that an implementation will be able to probe available hardware to associate it with the corresponding public key material.
In particular, there is no attempt to identify specific hardware or "slots" using identifiers like PKCS #11 URIs (<xref target="RFC7512"/>) or smartcard serial numbers (see <xref target="historical-notes"/>).
This minimalism is deliberate, as it's possible for the same key material to be available on multiple hardware devices, or for a device to be located on one platform with a particular hardware identifier, while on another platform it uses a different hardware identifier.</t>

<t>Not every OpenPGP implementation will be able to talk to every possible hardware device.
If an OpenPGP implementation encounters a hardware-backed secret key as indicated with this mechanism, but cannot identify any attached hardware that lists the corresponding secret key material, it should warn the user that the specific key claims to be hardware-backed but the corresponding hardware cannot be found.
It may also want to inform the user what categories of hardware devices it is capable of probing, for debugging purposes.</t>

</section>
<section anchor="multiple-key-hardware"><name>Hardware Should Support Multiple Secret Keys</name>

<t>Most reasonable OpenPGP configurations require the use of multiple secret keys by a single operator.
For example, the user may use one secret key for signing, and another secret key for decryption, and the corresponding public keys of both are contained in the same OpenPGP certificate.</t>

<t>Reasonable hardware <bcp14>SHOULD</bcp14> support embedding and identifying more than one secret key, so that a typical OpenPGP user can rely on a single device for hardware backing.</t>

</section>
<section anchor="authorization-challenges"><name>Authorization Challenges</name>

<t>Cryptographic hardware can be difficult to use if frequent authorization is required, particularly in circumstances like reading messages in a busy e-mail inbox.
This hardware <bcp14>MAY</bcp14> require authorization for each use of the secret key material as a security measure, but considerations should be made for caching authorization.</t>

<t>If the cryptographic hardware requires authorization for listing the corresponding public key material, it becomes even more difficult to use the device in regular operation.
Hardware <bcp14>SHOULD NOT</bcp14> require authorization for the action of producing the corresponding public key.</t>

<t>If a user has two attached pieces of hardware that both hold the same secret key, and one requires authorization while the other does not, it is reasonable for an implementation to try the one that doesn't require authorization first.
Some cryptographic hardware is designed to lock the device on repeated authorization failures (e.g. 3 bad PIN entries locks the device), so this approach reduces the risk of accidental lockout.</t>

</section>
<section anchor="latency-and-error-handling"><name>Latency and Error Handling</name>

<t>While hardware-backed secret key operations can be significantly slower than modern computers, and physical affordances like button-presses or NFC tapping can themselves incur delay, an implementation using a hardware-backed secret key should remain responsive to the user.
It should indicate when some interaction with the hardware may be required, and it should use a sensible timeout if the hardware device appears to be unresponsive.</t>

<t>A reasonable implementation should surface actionable errors or warnings from the hardware to the user where possible.</t>

</section>
</section>
<section anchor="iana-considerations"><name>IANA Considerations</name>

<t>This document asks IANA to make two changes in the "OpenPGP" protocol group.</t>

<t>Add the following row in the "OpenPGP Secret Key Encrpytion (S2K Usage Octet)" registry:</t>

<texttable title="Row to add to OpenPGP Secret Key Encrpytion (S2K Usage Octet) registry">
      <ttcol align='left'>S2K usage octet</ttcol>
      <ttcol align='left'>Shorthand</ttcol>
      <ttcol align='left'>Encryption parameter fields</ttcol>
      <ttcol align='left'>Encryption</ttcol>
      <ttcol align='left'>Generate?</ttcol>
      <c>TBD (252?)</c>
      <c>HardwareBacked</c>
      <c>none</c>
      <c>no data, see <xref target="spec"/> of RFC XXX (this document)</c>
      <c>Yes</c>
</texttable>

<t>Modify this row of the "OpenPGP Symmetric Key Algorithms" registry:</t>

<texttable title="Row to modify in OpenPGP Symmetric Key Algorithms registry">
      <ttcol align='right'>ID</ttcol>
      <ttcol align='left'>Algorithm</ttcol>
      <c>253, 254, and 255</c>
      <c>Reserved to avoid collision with Secret Key Encryption</c>
</texttable>

<t>to include TBD (252?) in this reserved codepoint sequence, resulting in the following entry:</t>

<texttable title="Modified row in OpenPGP Symmetric Key Algorithms registry">
      <ttcol align='right'>ID</ttcol>
      <ttcol align='left'>Algorithm</ttcol>
      <c>TBD (252?), 253, 254, and 255</c>
      <c>Reserved to avoid collision with Secret Key Encryption</c>
</texttable>

</section>


  </middle>

  <back>


    <references title='Normative References' anchor="sec-normative-references">



<reference anchor="RFC9580">
  <front>
    <title>OpenPGP</title>
    <author fullname="P. Wouters" initials="P." role="editor" surname="Wouters"/>
    <author fullname="D. Huigens" initials="D." surname="Huigens"/>
    <author fullname="J. Winter" initials="J." surname="Winter"/>
    <author fullname="Y. Niibe" initials="Y." surname="Niibe"/>
    <date month="July" year="2024"/>
    <abstract>
      <t>This document specifies the message formats used in OpenPGP. OpenPGP provides encryption with public key or symmetric cryptographic algorithms, digital signatures, compression, and key management.</t>
      <t>This document is maintained in order to publish all necessary information needed to develop interoperable applications based on the OpenPGP format. It is not a step-by-step cookbook for writing an application. It describes only the format and methods needed to read, check, generate, and write conforming packets crossing any network. It does not deal with storage and implementation questions. It does, however, discuss implementation issues necessary to avoid security flaws.</t>
      <t>This document obsoletes RFCs 4880 ("OpenPGP Message Format"), 5581 ("The Camellia Cipher in OpenPGP"), and 6637 ("Elliptic Curve Cryptography (ECC) in OpenPGP").</t>
    </abstract>
  </front>
  <seriesInfo name="RFC" value="9580"/>
  <seriesInfo name="DOI" value="10.17487/RFC9580"/>
</reference>

<reference anchor="RFC2119">
  <front>
    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
    <author fullname="S. Bradner" initials="S." surname="Bradner"/>
    <date month="March" year="1997"/>
    <abstract>
      <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
    </abstract>
  </front>
  <seriesInfo name="BCP" value="14"/>
  <seriesInfo name="RFC" value="2119"/>
  <seriesInfo name="DOI" value="10.17487/RFC2119"/>
</reference>

<reference anchor="RFC8174">
  <front>
    <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
    <author fullname="B. Leiba" initials="B." surname="Leiba"/>
    <date month="May" year="2017"/>
    <abstract>
      <t>RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
    </abstract>
  </front>
  <seriesInfo name="BCP" value="14"/>
  <seriesInfo name="RFC" value="8174"/>
  <seriesInfo name="DOI" value="10.17487/RFC8174"/>
</reference>




    </references>

    <references title='Informative References' anchor="sec-informative-references">

<reference anchor="OPENPGP-SMARTCARD" target="https://gnupg.org/ftp/specs/OpenPGP-smart-card-application-3.4.1.pdf">
  <front>
    <title>Functional Specification of the OpenPGP application on ISO Smart Card Operating Systems, Version 3.4.1</title>
    <author initials="A." surname="Pietig" fullname="Achim Pietig">
      <organization></organization>
    </author>
    <date year="2020" month="March" day="18"/>
  </front>
</reference>
<reference anchor="GNUPG-SECRET-STUB" target="https://dev.gnupg.org/source/gnupg/browse/master/doc/DETAILS;gnupg-2.4.3$1511">
  <front>
    <title>GNU Extensions to the S2K algorithm</title>
    <author initials="W." surname="Koch" fullname="Werner Koch">
      <organization>g10 Code</organization>
    </author>
    <date year="2023" month="July" day="04"/>
  </front>
</reference>
<reference anchor="TPM" target="https://trustedcomputinggroup.org/resource/tpm-library-specification/">
  <front>
    <title>Trusted Platform Module Library Specification, Family “2.0”, Level 00, Revision 01.59</title>
    <author >
      <organization>Trusted Computing Group</organization>
    </author>
    <date year="2019" month="November"/>
  </front>
</reference>
<reference anchor="SMART-CARD-FAULTS" target="http://hdl.handle.net/2117/99293">
  <front>
    <title>Smart Card Fault Injections with High Temperatures</title>
    <author initials="P. M. C." surname="Massolino" fullname="Pedro Maat C. Massolino">
      <organization></organization>
    </author>
    <author initials="B." surname="Ege" fullname="Baris Ege">
      <organization></organization>
    </author>
    <author initials="L." surname="Batina" fullname="Lejla Batina">
      <organization></organization>
    </author>
    <date year="2016" month="November" day="15"/>
  </front>
</reference>


<reference anchor="VOLTAGE-GLITCHING">
  <front>
    <title>The Forgotten Threat of Voltage Glitching: A Case Study on Nvidia Tegra X2 SoCs</title>
    <author fullname="Otto Bittner" initials="O." surname="Bittner">
      <organization/>
    </author>
    <author fullname="Thilo Krachenfels" initials="T." surname="Krachenfels">
      <organization/>
    </author>
    <author fullname="Andreas Galauner" initials="A." surname="Galauner">
      <organization/>
    </author>
    <author fullname="Jean-Pierre Seifert" initials="J." surname="Seifert">
      <organization/>
    </author>
    <date year="2021"/>
  </front>
  <seriesInfo name="DOI" value="10.48550/ARXIV.2108.06131"/>
<refcontent>arXiv</refcontent></reference>

<reference anchor="ROCA">
  <front>
    <title>The Return of Coppersmith's Attack: Practical Factorization of Widely Used RSA Moduli</title>
    <author fullname="Matus Nemec" initials="M." surname="Nemec">
      <organization>Masaryk University, Ca' Foscari University of Venice, Brno, Czech Rep</organization>
    </author>
    <author fullname="Marek Sys" initials="M." surname="Sys">
      <organization>Masaryk University, Brno, Czech Rep</organization>
    </author>
    <author fullname="Petr Svenda" initials="P." surname="Svenda">
      <organization>Masaryk University, Brno, Czech Rep</organization>
    </author>
    <author fullname="Dusan Klinec" initials="D." surname="Klinec">
      <organization>EnigmaBridge, Masaryk University, Brno, Czech Rep</organization>
    </author>
    <author fullname="Vashek Matyas" initials="V." surname="Matyas">
      <organization>Masaryk University, Brno, Czech Rep</organization>
    </author>
    <date month="October" year="2017"/>
  </front>
  <seriesInfo name="Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications" value="Security"/>
  <seriesInfo name="DOI" value="10.1145/3133956.3133969"/>
<refcontent>ACM</refcontent></reference>

<reference anchor="RFC7512">
  <front>
    <title>The PKCS #11 URI Scheme</title>
    <author fullname="J. Pechanec" initials="J." surname="Pechanec"/>
    <author fullname="D. Moffat" initials="D." surname="Moffat"/>
    <date month="April" year="2015"/>
    <abstract>
      <t>This memo specifies a PKCS #11 Uniform Resource Identifier (URI) Scheme for identifying PKCS #11 objects stored in PKCS #11 tokens and also for identifying PKCS #11 tokens, slots, or libraries. The URI scheme is based on how PKCS #11 objects, tokens, slots, and libraries are identified in "PKCS #11 v2.20: Cryptographic Token Interface Standard".</t>
    </abstract>
  </front>
  <seriesInfo name="RFC" value="7512"/>
  <seriesInfo name="DOI" value="10.17487/RFC7512"/>
</reference>




    </references>


<?line 226?>

<section anchor="historical-notes"><name>Historical notes</name>

<t>Some OpenPGP implementations make use of private codepoint ranges in the OpenPGP specification within an OpenPGP Transferable Secret Key to indicate that the secret key can be found on a smartcard.</t>

<t>For example, GnuPG uses the private/experimental codepoint 101 in the S2K Specifier registry, along with an embedded trailer with an additional codepoint, plus the serial number of the smartcard (see <xref target="GNUPG-SECRET-STUB"/>).</t>

<t>However, recent versions of that implementation ignore the embedded serial number in favor of scanning available devices for a match of the key material, since some people have multiple cards with the same secret key.</t>

</section>
<section anchor="test-vectors"><name>Test vectors</name>

<section anchor="example-transferable-secret-key"><name>Example Transferable Secret Key</name>

<t>The OpenPGP Transferable Secret Key used for this example. It includes (unencrypted) private key material for both its primary key and one subkey:</t>

<figure><sourcecode type="application/pgp-keys" name="software-backed.key"><![CDATA[
-----BEGIN PGP PRIVATE KEY BLOCK-----

xVgEZgWtcxYJKwYBBAHaRw8BAQdAlLK6UPQsVHR2ETk1SwVIG3tBmpiEtikYYlCy
1TIiqzYAAQCwm/O5cWsztxbUcwOHycBwszHpD4Oa+fK8XJDxLWH7dRIZzR08aGFy
ZHdhcmUtc2VjcmV0QGV4YW1wbGUub3JnPsKNBBAWCAA1AhkBBQJmBa1zAhsDCAsJ
CAcKDQwLBRUKCQgLAhYCFiEEXlP8Tur0WZR+f0I33/i9Uh4OHEkACgkQ3/i9Uh4O
HEnryAD8CzH2ajJvASp46ApfI4pLPY57rjBX++d/2FQPRyqGHJUA/RLsNNgxiFYm
K5cjtQe2/DgzWQ7R6PxPC6oa3XM7xPcCx10EZgWtcxIKKwYBBAGXVQEFAQEHQE1Y
XOKeaklwG01Yab4xopP9wbu1E+pCrP1xQpiFZW5KAwEIBwAA/12uOubAQ5nhf1UF
a51SQwFLpggB/Spn29qDnSQXOTzIDvPCeAQYFggAIAUCZgWtcwIbDBYhBF5T/E7q
9FmUfn9CN9/4vVIeDhxJAAoJEN/4vVIeDhxJVTgA/1WaFrKdP3AgL0Ffdooc5XXb
jQsj0uHo6FZSHRI4pchMAQCyJnKQ3RvW/0gm41JCqImyg2fxWG4hY0N5Q7Rc6Pyz
DQ==
=lYbx
-----END PGP PRIVATE KEY BLOCK-----
]]></sourcecode></figure>

</section>
<section anchor="as-an-external-secret-key"><name>As an External Secret Key</name>

<t>The same OpenPGP Transferable Secret Key with the S2K Usage Octet set to 252? (External) for both the Primary Key Packet and the Subkey Packet. This format omits all data following the S2K Usage Octet:</t>

<figure><sourcecode type="application/pgp-keys" name="external-secret.key"><![CDATA[
-----BEGIN PGP PRIVATE KEY BLOCK-----

xTQEZgWtcxYJKwYBBAHaRw8BAQdAlLK6UPQsVHR2ETk1SwVIG3tBmpiEtikYYlCy
1TIiqzb8zR08aGFyZHdhcmUtc2VjcmV0QGV4YW1wbGUub3JnPsKNBBAWCAA1AhkB
BQJmBa1zAhsDCAsJCAcKDQwLBRUKCQgLAhYCFiEEXlP8Tur0WZR+f0I33/i9Uh4O
HEkACgkQ3/i9Uh4OHEnryAD8CzH2ajJvASp46ApfI4pLPY57rjBX++d/2FQPRyqG
HJUA/RLsNNgxiFYmK5cjtQe2/DgzWQ7R6PxPC6oa3XM7xPcCxzkEZgWtcxIKKwYB
BAGXVQEFAQEHQE1YXOKeaklwG01Yab4xopP9wbu1E+pCrP1xQpiFZW5KAwEIB/zC
eAQYFggAIAUCZgWtcwIbDBYhBF5T/E7q9FmUfn9CN9/4vVIeDhxJAAoJEN/4vVIe
DhxJVTgA/1WaFrKdP3AgL0Ffdooc5XXbjQsj0uHo6FZSHRI4pchMAQCyJnKQ3RvW
/0gm41JCqImyg2fxWG4hY0N5Q7Rc6PyzDQ==
=3w/O
-----END PGP PRIVATE KEY BLOCK-----
]]></sourcecode></figure>

<t>The (primary) Secret-Key Packet of this key looks as follows, in this format:</t>

<figure><artwork><![CDATA[
0000  c5                        packet type: Secret-Key Packet
0001     34                     packet length
0002        04                  version
0003           66 05 ad 73      creation time
0007                       16   public-key algorithm: EdDSALegacy
0008  09                        curve OID length
0009     2b 06 01 04 01 da 47   curve OID
0010  0f 01
0012        01 07               EdDSA public key Q MPI length
0014              40 94 b2 ba   EdDSA public key Q MPI
0018  50 f4 2c 54 74 76 11 39
0020  35 4b 05 48 1b 7b 41 9a
0028  98 84 b6 29 18 62 50 b2
0030  d5 32 22 ab 36
0035                 fc         S2K usage octet
]]></artwork></figure>

</section>
</section>
<section anchor="acknowledgements"><name>Acknowledgements</name>

<t>This work depends on a history of significant work with hardware-backed OpenPGP secret key material, including useful implementations and guidance from many people, including:</t>

<t><list style="symbols">
  <t>NIIBE Yutaka</t>
  <t>Achim Pietig</t>
  <t>Werner Koch</t>
  <t>Heiko Schäfer</t>
</list></t>

<t>The people acknowledeged in this section are not responsible for any proposals, errors, or omissions in this document.</t>

</section>
<section anchor="document-history"><name>Document History</name>

<section anchor="substantive-changes-from-draft-dkg-openpgp-hardware-secrets-02-to-draft-dkg-openpgp-external-secrets-00"><name>Substantive Changes from draft-dkg-openpgp-hardware-secrets-02 to draft-dkg-openpgp-external-secrets-00</name>

<t><list style="symbols">
  <t>rename from "Hardware-backed" to "External"</t>
  <t>use RFC9580 instead of I-D.ietf-openpgp-crypto-refresh</t>
</list></t>

</section>
<section anchor="substantive-changes-from-draft-dkg-openpgp-hardware-secrets-01-to-draft-dkg-openpgp-hardware-secrets-02"><name>Substantive Changes from draft-dkg-openpgp-hardware-secrets-01 to draft-dkg-openpgp-hardware-secrets-02</name>

<t><list style="symbols">
  <t>re-format hexdump of test vector secret key packet</t>
</list></t>

</section>
<section anchor="substantive-changes-from-draft-dkg-openpgp-hardware-secrets-00-to-draft-dkg-openpgp-hardware-secrets-01"><name>Substantive Changes from draft-dkg-openpgp-hardware-secrets-00 to draft-dkg-openpgp-hardware-secrets-01</name>

<t><list style="symbols">
  <t>Added test vector for experimentation</t>
  <t>Mention on-device attestation</t>
  <t>update OpenPGP card spec reference to 3.4.1</t>
</list></t>

</section>
</section>


  </back>

<!-- ##markdown-source:
H4sIAAAAAAAAA61c6XLjRpL+j6eopTfC3WuBJHjo2vF4KIqS2LooUWpJnpjY
KQJFEi1cRgGk2HZPzIPsRuyPfZLdN5kn2cyswkVSajvGHW2LwlGVlceXX2YV
2zRNI3ETTxyy60gEo9MRG7wkIg64x8bCjkXCzsVKGk5oB9yHp5yYTxPTeZ6Z
ITwfzSJT6OdNSc9Ls9k0bJ6IWRivDpkbTEPDcKP4kCVxKpNWs3nQbBk8Fhxv
JsYyjJ9ncZhGh0yPaDyLFVx1DtkwwKFFYh7jrIZMJ74rpRsGd6sIZBkO7k4M
QyY8cP6De2EAl1ZCGpF7yP6chPYOk2GcxGIq4dPKxw9/MQyeJvMwPjSYaTD4
4wbykB3X2Xmdnbqe54cxXVaLPeaBKzx2zudB5W4Yzw5Zzxexa/OA9d2F67EL
dyLixBWS3QcgIT0nYXaRHDKr1WVHccgdNk7qdMd2E1DOlViyJ1j/Drt6UpdD
B6a1ms1mR/+eBgmq8X7cowt8MonFAibvX9zTBeFz1wOzPM/+NHWnyRzWJuFa
UAe1GQsRpAKWyrSCa9rGNbiUkAprDzC9G8zYKT6B19V4NW2LP7kimdZhvXiL
x/Ycbs2TJJKHjQY+iZfchahnjzXwQmMSh0spGnqMBr4biygsvTsDn+OTuh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