<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.11 (Ruby 3.2.4) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-bastian-dvs-jose-00" category="info" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.21.0 -->
  <front>
    <title abbrev="DVS for JOSE">Designated Verifier Signatures for JOSE</title>
    <seriesInfo name="Internet-Draft" value="draft-bastian-dvs-jose-00"/>
    <author fullname="Paul Bastian">
      <organization>Bundesdruckerei GmbH</organization>
      <address>
        <email>bastianpaul@googlemail.com</email>
      </address>
    </author>
    <date year="2024" month="June" day="07"/>
    <area>Security</area>
    <workgroup>Javascript Object Signing and Encryption</workgroup>
    <keyword>next generation</keyword>
    <keyword>unicorn</keyword>
    <keyword>sparkling distributed ledger</keyword>
    <abstract>
      <?line 40?>

<t>This specification defines designated verifier signatures for JOSE and defines algorithms that use a combination of key agreement and MACs.</t>
    </abstract>
    <note removeInRFC="true">
      <name>About This Document</name>
      <t>
        The latest revision of this draft can be found at <eref target="https://paulbastian.github.io/draft-bastian-dvs-jose/draft-bastian-dvs-jose.html"/>.
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-bastian-dvs-jose/"/>.
      </t>
      <t>
        Discussion of this document takes place on the
        Javascript Object Signing and Encryption Working Group mailing list (<eref target="mailto:jose@ietf.org"/>),
        which is archived at <eref target="https://mailarchive.ietf.org/arch/browse/jose/"/>.
        Subscribe at <eref target="https://www.ietf.org/mailman/listinfo/jose/"/>.
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://github.com/paulbastian/draft-bastian-dvs-jose"/>.</t>
    </note>
  </front>
  <middle>
    <?line 44?>

<section anchor="introduction">
      <name>Introduction</name>
      <t>Designated verifier signatures (DVS) are signature schemes in which signatures are generated, that can only be verified a particular party. Unlike conventional digital signature schemes like ECDSA, this enables repudiable signatures.</t>
      <t>This specification describes a general structure for designated verifier signature schemes and specified a set of instantiations that use a combination of an ECDH key exchange with an HMAC.</t>
      <t>This specification and all described algorithms should respect the efforts for (Fully Specified Algorithms)[https://www.ietf.org/archive/id/draft-jones-jose-fully-specified-algorithms-00.html].</t>
      <t>This algorithm is intended for use with digital credentials ecosystems, including the Issuer-Holder-Verifier model described by W3C VCDM or IETF SD-JWT-VC.</t>
    </section>
    <section anchor="conventions-and-definitions">
      <name>Conventions and Definitions</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>The draft uses "JSON Web Signature", "JOSE Header", "JWS Signature", "JWS Signing Input" as defined by <xref target="RFC7515"/>.</t>
      <dl>
        <dt>Signing Party:</dt>
        <dd>
          <t>The Party that performs the key agreement first and generates the MAC. Similar to a Signer.</t>
        </dd>
        <dt>Verifying Party:</dt>
        <dd>
          <t>The Party that performs the key agreement second, generates the MAC and compares it to a given value. Similar to a Verifier.</t>
        </dd>
      </dl>
    </section>
    <section anchor="cryptographic-dependencies">
      <name>Cryptographic Dependencies</name>
      <t>DVS uses the following notation:</t>
      <t>TODO</t>
      <t>DVS rely on the following primitives:</t>
      <t>TODO</t>
    </section>
    <section anchor="designates-verifier-signatures">
      <name>Designates Verifier Signatures</name>
      <t>A designated verifier signature requires three components for an algorithm:</t>
      <ol spacing="normal" type="1"><li>
          <t>a Diffie-Hellman Key Agreement (DHKA)</t>
        </li>
        <li>
          <t>a Key Derivation Function (KDF)</t>
        </li>
        <li>
          <t>a Message Authentication Code algorithm (MAC)</t>
        </li>
      </ol>
      <t>In general, these parameters are chosen by the Signing Party. These parameters need to be communicated to the Verifying Party before the generation of a Designated Verifier Signature.</t>
      <section anchor="signature-generation">
        <name>Signature Generation</name>
        <t>The generation of the Designated Verifier Signature takes the private key of the Signing Party, the public key of the Verifying Party and the message as inputs. The retrieval and communication of the Verifying Party's public key is out of scope of this specification and subject to the implementing protocols.</t>
        <t>The generation of the signature follows these steps:</t>
        <ol spacing="normal" type="1"><li>
            <t>Perform the key agreement as defined by the DHKA algorithm
  - use the specified elliptic curve to generate a key pair and set the <tt>epk</tt>
  - use the Verifier's public key defined by <tt>kid</tt> to perform the key agreement
  - optionally provide a certificate chain defined by <tt>x5c</tt></t>
          </li>
          <li>
            <t>Extract and expand the shared secret as defined by KDF algorithm
  - use the output from the key agreement as an input for the key derivation algorithm
  - derive the MAC key</t>
          </li>
          <li>
            <t>Generate a MAC as defined by MAC algorithm
  - use the output from the key derivation algorithm as an input for the MAC algorithm
  - use the <tt>JWS Signing Input</tt> as defined in Section 5.1 if <xref target="RFC7515"/> as the <tt>message</tt> input for the MAC algorithm
  - generate the MAC</t>
          </li>
        </ol>
        <t>The verification of signature follows these steps:</t>
        <ol spacing="normal" type="1"><li>
            <t>Perform key agreement as defined by the DHKA algorithm
  - use the specified elliptic curve to generate an ephemeral key pair and set the <tt>kid</tt>
  - provide the public key <tt>kid</tt> to the Signing Party
  - use the Signing Party's public key defined by <tt>epk</tt> and perform the key agreement
  - optionally validate the certificate chain defined by <tt>x5c</tt></t>
          </li>
          <li>
            <t>Extract and expand the shared secret as defined by KDF algorithm
  - use the output from the key agreement as an input for the key derivation algorithm
  - derive the MAC key</t>
          </li>
          <li>
            <t>Generate a MAC as defined by MAC algorithm
  - use the output from the key derivation algorithm as an input for the MAC algorithm
  - generate the MAC</t>
          </li>
          <li>
            <t>Compare the generated MAC with the signature value</t>
          </li>
        </ol>
      </section>
    </section>
    <section anchor="designated-verifier-signatures-for-jose">
      <name>Designated Verifier Signatures for JOSE</name>
      <t>Designated Verifier Signatures behave like a digital signature as described in Section 3 of <xref target="RFC7518"/> and are intended for use in JSON Web Signatures (JWS) as described in <xref target="RFC7515"/>. The Generating Party performs the <tt>Message Signature or MAC Computation</tt> as defined by Section 5.1 of <xref target="RFC7515"/>. The Verifying Party performs the <tt>Message Signature or MAC Validation</tt> as defined by Section 5.2 of <xref target="RFC7515"/>.</t>
      <t>The following JWS headers are used to convey Designated Verifier Signatures for JOSE:</t>
      <ul spacing="normal">
        <li>
          <t><tt>alg</tt> : The algorithm parameter describes the chosen signature suite, for example the ones described in (#suites)</t>
        </li>
        <li>
          <t><tt>jwk</tt> : The <tt>jwk</tt> parameter represents the encoded public key of the Signing Party for the use in the DHKA algorithm as a JSON Web Key according to <xref target="RFC7517"/>. It <bcp14>MUST</bcp14> contain only public key parameters and <bcp14>SHOULD</bcp14> contain only the minimum JWK parameters necessary to represent the key. Usage of this parameter <bcp14>MUST</bcp14> be supported.</t>
        </li>
        <li>
          <t><tt>x5c</tt> : The <tt>x5c</tt> parameter represents the encoded certificate chain and its leaf public key of the Signing Party for the use in the DHKA algorithm as a X.509 certificate chain according to <xref target="RFC7517"/>. Alternatively, the Signing Party may use "x5t", x5t#S256" or "x5u". Usage of this parameter <bcp14>MAY</bcp14> be supported.</t>
        </li>
        <li>
          <t><tt>rpk</tt> : The <tt>rpk</tt> (recipient public key) parameter represents the encoded public key of the Verifying Party that was used in the DHKA algorithm as a JSON Web Key according to <xref target="RFC7517"/>. This parameter <bcp14>MUST</bcp14> be present.</t>
        </li>
      </ul>
      <section anchor="example-jwt">
        <name>Example JWT</name>
        <t>The JWT/JWS header:</t>
        <artwork><![CDATA[
{
    "typ" : "JWT",
    "alg" : "DVS-P256-SHA256-HS256",
    "jwk" : <JWK of the Signing Party>,
    "rpk" : <JWK of Verifying Party>
}
]]></artwork>
        <t>The JWT/JWS payload:</t>
        <artwork><![CDATA[
{
    "iss" : "https://example.as.com",
    "iat" : "1701870613",
    "given_name" : "Erika",
    "family_name" : "Mustermann"
}
]]></artwork>
        <t>The JWT/JWS signature:</t>
        <artwork><![CDATA[
base64-encoded MAC
]]></artwork>
      </section>
    </section>
    <section anchor="suites">
      <name>Signature Suites</name>
      <t>Algorithms <bcp14>MUST</bcp14> follow the naming <tt>DVS-&lt;DHKA&gt;-&lt;KDF&gt;-&lt;MAC&gt;</tt>.</t>
      <t>This specification described instantiations of Designated Verifier Signatures using specific algorithm combinations:</t>
      <artwork type="ascii-art"><![CDATA[
+-----------------------+-----------------------------+----------------+
| Algorithm Name        | Algorithm Description       |                |
|                       |                             | Requirements   |
+-----------------------+-----------------------------+----------------+
| DVS-P256-SHA256-HS256 | ECDH using NIST P-256,      | Optional       |
|                       | HKDF using SHA-256 and      |                |
|                       | HMAC using SHA-256          |                |
+--------------------+--------------------------------+----------------+
]]></artwork>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>TODO Security</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>Define:</t>
      <ul spacing="normal">
        <li>
          <t><tt>rpk</tt> header parameter</t>
        </li>
        <li>
          <t>alg values for DVS-P256-SHA256-HS256 and some more</t>
        </li>
      </ul>
    </section>
  </middle>
  <back>
    <references anchor="sec-normative-references">
      <name>Normative References</name>
      <reference anchor="RFC7515">
        <front>
          <title>JSON Web Signature (JWS)</title>
          <author fullname="M. Jones" initials="M." surname="Jones"/>
          <author fullname="J. Bradley" initials="J." surname="Bradley"/>
          <author fullname="N. Sakimura" initials="N." surname="Sakimura"/>
          <date month="May" year="2015"/>
          <abstract>
            <t>JSON Web Signature (JWS) represents content secured with digital signatures or Message Authentication Codes (MACs) using JSON-based data structures. Cryptographic algorithms and identifiers for use with this specification are described in the separate JSON Web Algorithms (JWA) specification and an IANA registry defined by that specification. Related encryption capabilities are described in the separate JSON Web Encryption (JWE) specification.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="7515"/>
        <seriesInfo name="DOI" value="10.17487/RFC7515"/>
      </reference>
      <reference anchor="RFC7517">
        <front>
          <title>JSON Web Key (JWK)</title>
          <author fullname="M. Jones" initials="M." surname="Jones"/>
          <date month="May" year="2015"/>
          <abstract>
            <t>A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. This specification also defines a JWK Set JSON data structure that represents a set of JWKs. Cryptographic algorithms and identifiers for use with this specification are described in the separate JSON Web Algorithms (JWA) specification and IANA registries established by that specification.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="7517"/>
        <seriesInfo name="DOI" value="10.17487/RFC7517"/>
      </reference>
      <reference anchor="RFC7518">
        <front>
          <title>JSON Web Algorithms (JWA)</title>
          <author fullname="M. Jones" initials="M." surname="Jones"/>
          <date month="May" year="2015"/>
          <abstract>
            <t>This specification registers cryptographic algorithms and identifiers to be used with the JSON Web Signature (JWS), JSON Web Encryption (JWE), and JSON Web Key (JWK) specifications. It defines several IANA registries for these identifiers.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="7518"/>
        <seriesInfo name="DOI" value="10.17487/RFC7518"/>
      </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>
    <?line 212?>

<section numbered="false" anchor="acknowledgments">
      <name>Acknowledgments</name>
      <t>TODO acknowledge.</t>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA+1ZW3fbNhJ+56/Ayg9rt6YcJXHs6mTTKpYdO4kvGznx5vT0
rCASkhCTAAuQlrWu81v2t+wv25kBr7o4Sbd9Wz9YJG4z+OabC0Df971UppHo
slZfWDlRPBUh+yCMHEth2IBaMiMsG2vDXp8PDlseH42MuMEZHwa15gCmTrSZ
d5lUY+15oQ4Uj2Hl0PBx6o+4TSVXfnhj/U/aCv/RI89mo1haK7VK5wmMPDm8
PGJsg/HIalhfqlAkAv6ptLXNWiKUqTaSR/hy0nsJPyC8dfLu8qjlqSweCdP1
QtCi6wVaWaFsZrssNZnwQNsnHjeCw6oDEWRGpvOWN9PmemJ0lkDra37DbWBk
krLz0ScRpLR3qSaMq5AdqsDMkxQUbXnXYg4Tw67HfKbEbcomQgnDsRObMiUD
bejRJtxcR7hGKG1q5ChDcCMRToTxboTKQFPGvl0DxhxcrSvYAA54hUtge8xl
BO2I709SpOO2NhNs5yaYQvs0TRPb3dnBYdgkb0S7GLaDDTsjo2dW7OACOzhx
ItNpNoKpCc+i3IQ7qw2KwyNA36Y1SbVpbbdWW+o1C6xpbk/TOGp5Hs/SqTYI
OwhibJxFkePXBchgL90s6oLdcCX/RSbpspcZMMiGJguuhRG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