Internet-Draft OpenPGP smart card extensions November 2026
Schäfer Expires 22 May 2027 [Page]
Workgroup:
openpgp
Internet-Draft:
draft-hko-openpgp-card-extension
Published:
Intended Status:
Informational
Expires:
Author:
H. Schäfer

OpenPGP smart card extensions

Abstract

This document describes extensions for the OpenPGP smart card application. It adds algorithm support for PQC composite algorithms, as well as support for additional key storage.

About This Document

This note is to be removed before publishing as an RFC.

The latest revision of this draft can be found at https://openpgp-card.codeberg.page/spec/. Status information for this document may be found at https://datatracker.ietf.org/doc/draft-hko-openpgp-card/.

Discussion of this document takes place on the OpenPGP Working Group mailing list (mailto:openpgp@ietf.org), which is archived at https://mailarchive.ietf.org/arch/browse/openpgp/. Subscribe at https://www.ietf.org/mailman/listinfo/openpgp/.

Source for this draft and an issue tracker can be found at https://codeberg.org/openpgp-card/spec/.

Status of This Memo

This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.

Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.

Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."

This Internet-Draft will expire on 22 May 2027.

▲

Table of Contents

1. Introduction

This document describes a set of extensions to the OpenPGP smart card application ([OPENPGP-SMARTCARD]). The extensions are based on version 3.4.1.

The goals of these extensions are:

1.1. Requirements Language

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.

2. Upstreaming notes

If this extension were added into the upstream version of the spec, the following note should be added to the document history.

V3.4.1 to 3.5:

3. Extended algorithm support

This section extends the existing set of algorithms in OpenPGP card to encompass additional classic ECC algorithms, as well as PQC algorithms. Those new algorithms act largely analogously to the pre-existing algorithms.

3.1. ECC algorithms

3.1.1. Page 23 (in DO table)

"C1-C3: 1 Byte Algorithm ID, according to RFC 4880/6637/9580/9980"

(add RFCs 9580/9980 as sources of algorithm ids)

Also see https://www.iana.org/assignments/openpgp/openpgp.xhtml#openpgp-public-key-algorithms

3.1.2. Page 34f (4.4.3.9 Algorithm Attributes)

3.1.2.1. Add EdDSA algorithm

Add to table (and adjust text over table to say "ECC:"):

"0x16 (decimal 22) = EdDSA for PSO:CDS and INT-AUT"

3.1.3. Page 35f (4.4.3.10 Supported algorithms)

3.1.3.1. Add EdDSA (as Optional)
  • EdDSA 256 bit or higher for PSO:COMPUTE DIGITAL SIGNATURE and INTERNAL AUTHENTICATE

Add Ed25519 as a recommended variant of EdDSA, and Ed448 as an optional variant.

Note: In OpenPGP card, pure EdDSA keys always use algorithm id 0x16, combined with the OID of the curve. Algorithm ids 0x1b and 0x1c are not used by the OpenPGP card application (these ids are designated "Ed25519" and "Ed448" in RFC 9580).

3.1.3.2. Add Curve 25519 and 448 for use with ECDH

Add Curve 25519 as a recommended curve for ECDH, and Curve 448 as an optional curve for ECDH.

Note: Pure ECDH over Curve 25519 and Curve 448 always uses algorithm id 0x12 in OpenPGP card, combined with the OID of the curve used. Algorithm ids 0x19 and 0x1a are not used by the OpenPGP card application (these ids are designated "X25519" and "X448" in RFC 9580).

3.1.3.3. Caution: Import byte order for Curve 25519 over ECDH

When importing ECDH key material that uses Curve 25519, the scalar must be uploaded in little endian byte ordering. This specific case is handled differently from all other ECC scalars in OpenPGP card!

This special case applies exclusively to ECDH over Curve25519 (also known as X25519). Note: Gnuk already implements X448, and uses "normal" big endian ordering for it.

3.1.4. Page 101 ff (10 Domain parameter of supported elliptic curves)

3.1.4.1. OIDs used for Ed25519/X25519 and Ed448/X448, in OpenPGP card:

Refer to https://www.rfc-editor.org/info/rfc7748/ and https://www.rfc-editor.org/info/rfc8032/ for more details about these curves, and the EdDSA algorithm.

See https://www.rfc-editor.org/info/rfc9580/#table-19 for the "OpenPGP ECC Curve OIDs and Usage Registry"

3.2. PQC algorithms

This section adds support for algorithms from RFC 9980 (PQC in OpenPGP).

PQC composite algorithms are modeled as a combined key in OpenPGP card, internally such keys are handled as two distinct cryptographic keys.

This representation mirrors OpenPGP key packets, and allows annotating key material on the card with key packet fingerprints, to aid interoperable use of key material on the card between applications.

Once draft-ietf-openpgp-nist-bp-comp is finalized, its algorithm ids should be added to this spec as a minor update (with guidance to point out which ids should be prioritized by implementers).

(Note that this design is also fully usable by implementations of the PQC format outlined in draft-koch-librepgp.)

3.2.1. Page 34f (4.4.3.9 Algorithm Attributes)

3.2.1.1. Add a separate PQC algorithm table
Byte  Length Value

01     01     Algorithm ID (RFC 9980)
                 30: ML-DSA-65+Ed25519
                 31: ML-DSA-87+Ed448
                 32: SLH-DSA-SHAKE-128s
                 33: SLH-DSA-SHAKE-128f
                 34: SLH-DSA-SHAKE-256s
                 35: ML-KEM-768+X25519
                 36: ML-KEM-1024+X448
02     01     Import-Format, optional (00 is standard, and used if this value is not present)
                00: standard: scalar value of ECC private key (optional, only for composite ML-KEM or ML-DSA), and scalar value for PQC private key
                01: scalar value of ECC private key, and seed for PQC key (Import-Format only applicable for composite schemes with ML-KEM or ML-DSA)
                02: scalar value of ECC private and public key (optional, only for composite ML-KEM or ML-DSA), and scalar value for PQC private key
                03: scalar value of ECC private and public key, and seed for PQC key (Import-Format only applicable for composite schemes with ML-KEM or ML-DSA)

Note: No OIDs are needed for the ECC component when using these PQC algorithm IDs

TODO (future minor update to this spec): Add IDs from draft-ietf-openpgp-nist-bp-comp-03, once finalized

NOTE: OIDs for PQC algorithms are not required in the OpenPGP card application. Both the cryptographic algorithm(s) and parameter size(s) are inferred directly from the algorithm id, as set in the algorithm attributes.

3.2.2. Add "Post-Quantum Cryptography" (as optional algorithms)

3.2.2.1. "PQC Composite KEM algorithms"

Optional to implement: Combinations of ML-KEM and ECDH, as specified for use with OpenPGP.

Products that offer any PQC support should usually offer support for at least ML-KEM-768+X25519 (RFC 9980 defines ML-KEM-768+X25519 as a "MUST" algorithm).

Note: The OpenPGP smart card application handles the two component KEM algorithms within one DEC key on the card. However, only the two individual decryption operations are performed on the card. The KEM combination step must be performed on the host system!

3.2.2.2. "PQC Composite Signature algorithms"

Optional to implement: Combinations of ML-DSA and EdDSA or ECDSA, as specified for use with OpenPGP.

Products that offer any PQC support should usually offer support for at least ML-DSA-65+Ed25519 (RFC 9980 defines ML-DSA-65+Ed25519 as a "MUST" algorithm).

Note: The OpenPGP smart card application handles the two component signature algorithms of a PQC composite within a single SIG or AUT key on the card.

3.2.2.3. "PQC Stand alone Signature algorithms"

Optional: Stand alone PQC signature algorithms, as specified for use with OpenPGP.

SLH-DSA may be implemented in the variants SLH-DSA-SHAKE-128s, SLH-DSA-SHAKE-128f, SLH-DSA-SHAKE-256s.

3.2.3. Page 38 ff (4.4.3.12 Private Key Template)

3.2.3.1. PQC handling in Control Reference Template

Under "7F48 xx Cardholder private key template":

92 xx Private ECC key (optional, present for composite schemes)
99 xx Public ECC key (optional, present for composite schemes if Import-Format is 02 or 03)
9a xx PQC private key (optional, present if Import-Format is 00 or 02)
9b xx PQC private key in seed form (optional, present if Import-Format is 01 or 03)

3.2.4. Page 63 ff (7.2.10 PSO: COMPUTE DIGITAL SIGNATURE)

For PQC composite signature algorithms, the return value represents the concatenation of the two individual cryptographic signatures.

The ECC signature is returned first (if the algorithm is a composite signature), followed by the PQC signature. Both values are always returned in big-endian format, each value zero-padded to the signature size.

3.2.5. Page 67 ff (7.2.11 PSO: DECIPHER)

The input data consists of the concatenation of the "ecdhCipherText" and "mlkemCipherText", with fixed octet sizes as specified for the algorithm for the key slot.

For PQC composite KEM algorithms, the return value represents the concatenation of the two individual decapsulated key shares, first "ecdhKeyShare", then "mlkemKeyShare", both in big-endian format.

Internally, the card performs the two operations "ECDH-KEM.Decaps" and "ML-KEM.Decaps" as specified in https://www.rfc-editor.org/info/rfc9980/#name-composite-kem-schemes

3.2.6. Page 71 ff (7.2.13 INTERNAL AUTHENTICATE)

For PQC composite signature algorithms, the return value represents the concatenation of the two individual cryptographic signatures.

See "7.2.10 PSO: COMPUTE DIGITAL SIGNATURE" for details about the return format.

3.2.7. Page 74 ff (7.2.14 GENERATE ASYMMETRIC KEY PAIR)

Public key parameters for PQC algorithms are returned analogously to RSA and ECC. The additional parameter type 0x9c is used for PQC public key parameters:

0x9c xx PQC public key component (ML-KEM, ML-DSA or SLH-DSA)

4. Extended key storage

TODO

5. Security Considerations

TODO

6. Usability Considerations

TODO

7. References

7.1. Normative References

[RFC2119]
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, , <https://www.rfc-editor.org/rfc/rfc2119>.
[RFC8174]
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, , <https://www.rfc-editor.org/rfc/rfc8174>.

7.2. Informative References

[OPENPGP-SMARTCARD]
Pietig, A., "Functional Specification of the OpenPGP application on ISO Smart Card Operating Systems, Version 3.4.1", , <https://gnupg.org/ftp/specs/OpenPGP-smart-card-application-3.4.1.pdf>.

Acknowledgements

This document is based on significant work by many people, including implementations and guidance:

The people acknowledged in this section are not responsible for any proposals, errors, or omissions in this document.

Document History

Author's Address

Heiko Schäfer