CURLOPT\_HTTPSIG\_ALGORITHM(3) Library Functions Manual CURLOPT\_HTTPSIG\_ALGORITHM(3)

# [NAME](#NAME)

CURLOPT\_HTTPSIG\_ALGORITHM - RFC 9421 HTTP Message Signatures algorithm

# [SYNOPSIS](#SYNOPSIS)

```
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HTTPSIG_ALGORITHM,


                          long algorithm);
```

# [DESCRIPTION](#DESCRIPTION)

This feature is **experimental** and may change before it is considered stable. We advise against using it in production.

Enable RFC 9421 HTTP Message Signatures on outgoing requests. Pass a long set to one of the values below to select the signing algorithm.

[CURLHTTPSIG\_NONE (0)](#CURLHTTPSIG_NONE)

Disable HTTP Message Signatures.

[CURLHTTPSIG\_ED25519 (1)](#CURLHTTPSIG_ED25519)

Sign with Ed25519 (RFC 8032). Requires a TLS backend with Ed25519 support.

[CURLHTTPSIG\_HMAC\_SHA256 (2)](#CURLHTTPSIG_HMAC_SHA256)

Sign with HMAC-SHA256.

Setting this option to a non-zero value also sets [*CURLOPT\_HTTPAUTH(3)*](/man/os/curl/CURLOPT_HTTPAUTH.3) to CURLAUTH\_HTTPSIG. The options [*CURLOPT\_HTTPSIG\_KEY(3)*](/man/os/curl/CURLOPT_HTTPSIG_KEY.3) and [*CURLOPT\_HTTPSIG\_KEYID(3)*](/man/os/curl/CURLOPT_HTTPSIG_KEYID.3) must also be set.

# [DEFAULT](#DEFAULT)

CURLHTTPSIG\_NONE (0)

# [PROTOCOLS](#PROTOCOLS)

This functionality affects http only

# [EXAMPLE](#EXAMPLE)

```
int main(void)
{


  CURL *curl = curl_easy_init();


  if(curl) {


    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/api");


    curl_easy_setopt(curl, CURLOPT_HTTPSIG_ALGORITHM, CURLHTTPSIG_ED25519);


    curl_easy_setopt(curl, CURLOPT_HTTPSIG_KEY,


                     "9f8362f87a484a954e6e740c5b4c0e84"


                     "229139a20aa8ab56ff66586f6a7d29c5");


    curl_easy_setopt(curl, CURLOPT_HTTPSIG_KEYID, "my-key-id");


    curl_easy_perform(curl);


  }
}
```

# [AVAILABILITY](#AVAILABILITY)

Added in curl 8.22.0

# [RETURN VALUE](#RETURN_VALUE)

[*curl\_easy\_setopt(3)*](/man/os/curl/curl_easy_setopt.3) returns a CURLcode indicating success or error.

CURLE\_OK (0) means everything was OK, non-zero means an error occurred, see [*libcurl-errors(3)*](/man/os/curl/libcurl-errors.3).

# [SEE ALSO](#SEE_ALSO)

[**CURLOPT\_HTTPAUTH**(3)](/man/os/curl/CURLOPT_HTTPAUTH.3), [**CURLOPT\_HTTPSIG\_HEADERS**(3)](/man/os/curl/CURLOPT_HTTPSIG_HEADERS.3), [**CURLOPT\_HTTPSIG\_KEY**(3)](/man/os/curl/CURLOPT_HTTPSIG_KEY.3), [**CURLOPT\_HTTPSIG\_KEYID**(3)](/man/os/curl/CURLOPT_HTTPSIG_KEYID.3)

2026-10-22 libcurl

---

Document: CURLOPT_HTTPSIG_ALGORITHM(3) from curl 8.23.0-r2 (Chainguard OS)
Source: https://github.com/curl/curl.git
