<?xml version="1.0" encoding="UTF-8"?>
  <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
  <!-- generated by https://github.com/cabo/kramdown-rfc version  (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-hardware-secrets-02" category="info" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true">
  <front>
    <title>OpenPGP Hardware-Backed 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="April" day="19"/>

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

    <abstract>


<t>This document defines a standard wire format for indicating that the secret component of an OpenPGP asymmetric key is stored on a hardware device.</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-hardware-secrets/"/>.
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-dkg-openpgp-hardware-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-hardware-secrets/"/>.</t>
    </note>


  </front>

  <middle>


<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 hardware-backed secrets 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="I-D.ietf-openpgp-crypto-refresh"/>) is typically used as part of a Transferable Secret Key (<xref section="10.2" sectionFormat="of" target="I-D.ietf-openpgp-crypto-refresh"/>) for interoperability between OpenPGP implementations.
An implementation that uses a hardware-backed secret key needs a standardized way to indicate to another implementation specific secret key material has been delegated to some hardware device.</t>

<t>This document defines a simple mechanism for indicating that a secret key has been delegated to a hardware device by allocating a codepoint in the "Secret Key Encryption (S2K Usage Octet)" registry (see <xref section="3.7.2.1" sectionFormat="of" target="I-D.ietf-openpgp-crypto-refresh"/>).</t>

<t>This document makes no attempt to specify how an OpenPGP implementation discovers, enumerates, or operates hardware, other than to recommend that the hardware 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>

</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="I-D.ietf-openpgp-crypto-refresh"/>.</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="I-D.ietf-openpgp-crypto-refresh"/>).</t>

<t>"Hardware" 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 hardware is also expected to be able to produce the public key corresponding to the embedded secret key.</t>

<t>While this document talks about "hardware" in the abstract as referring to a cryptographic device embedding a single secret key, most actual hardware devices 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 hardware may require for an action.</t>

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

<t>An OpenPGP Secret Key packet (<xref section="5.5.3" sectionFormat="of" target="I-D.ietf-openpgp-crypto-refresh"/>) indicates that the secret key material is stored in cryptographic hardware 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">HardwareBacked</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>Hardware-backed secret keys promise several distinct security advantages to the user:</t>

<t><list style="symbols">
  <t>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>Hardware-backed 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'>




<reference anchor='I-D.ietf-openpgp-crypto-refresh'>
   <front>
      <title>OpenPGP</title>
      <author fullname='Paul Wouters' initials='P.' surname='Wouters'>
         <organization>Aiven</organization>
      </author>
      <author fullname='Daniel Huigens' initials='D.' surname='Huigens'>
         <organization>Proton AG</organization>
      </author>
      <author fullname='Justus Winter' initials='J.' surname='Winter'>
         <organization>Sequoia-PGP</organization>
      </author>
      <author fullname='Niibe Yutaka' initials='N.' surname='Yutaka'>
         <organization>FSIJ</organization>
      </author>
      <date day='4' month='January' 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.

   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.

   This document obsoletes: RFC 4880 (OpenPGP), RFC 5581 (Camellia in
   OpenPGP) and RFC 6637 (Elliptic Curves in OpenPGP).

	 </t>
      </abstract>
   </front>
   <seriesInfo name='Internet-Draft' value='draft-ietf-openpgp-crypto-refresh-13'/>
   
</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'>

<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='arXiv' value='article'/>
  <seriesInfo name='DOI' value='10.48550/ARXIV.2108.06131'/>
</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'/>
</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>


<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-a-hardware-backed-secret-key"><name>As a Hardware-Backed Secret Key</name>

<t>The same OpenPGP Transferable Secret Key with the S2K Usage Octet set to 252? (HardwareBacked) 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="hardware-backed.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-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>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-1"><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:
H4sIAAAAAAAAA71c6XLjSHL+j6eo5Thiuj3iAR667PEsRVISWxclUi1pNja8
IFAE0cI1KIAUNdMT+yB2hH/4Sew32SdxZlbh4qHujphwR+80iaMqK48vv8wq
brVa1WIndvkxuwm5PzobsXMjspZGxKsnhvnMLTbmZsRjdsFXQrMC0zc8eNiK
jFlctZ7tagCvhXZYnaevCXpeVBtNzTRibgfR6pg5/izQNCeMjlkcJSJuNhpH
8AA8b+DNWFsG0bMdBUl4zNSI2jNfwVXrmA39mEc+j6t9nFUTydRzhHACf7IK
QZbhYHKqaSI2fOvfDTfw4dKKCy10jtlf4sDcYyKI4ojPBHxaefjhr5pmJPE8
iI41VtUY/HF8ccz6NXZRY2eO63pBRJflYvuG73CXXRhzv3Q3iOxj1vV45JiG
z3rOwnHZpTPlUexwwe59kJCeEzA7j4+Z3uywkygwQKdxje6YTgzKueZL9gTr
32PXT/JyYMG0eqPRaKvviR+jGu/HXbpgTKcRX8Dkvct7usA9w3HBLM/2n2fO
LJ7D2gRc82ugNm3B/YTDUplScEWZugKXYlJh5QGmd3ybneETeF2OV1G2+LPD
41kN1ou3jMicw615HIfiuF7HJ/GSs+C19LE6XqhPo2ApeF2NUcd3Ix4GhXdt
cD1jWjMDrw6i13f5Er3qgjOJuPAyvFFTAzjBW++i80WeEYOEoIWb0eAaFl8d
X3XvJr3u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