CURLOPT_HTTPSIG_KEYID(3)
β¨ CURLOPT_HTTPSIG_KEYID(3) β¨
okay so bestie, welcome to the CURLOPT_HTTPSIG_KEYID page β it lives in the libcurl manual and it's literally all about telling the server which key you signed with π
π NAME π
CURLOPT_HTTPSIG_KEYID β the key identifier for HTTP Message Signatures, iykyk
π¦ SYNOPSIS π¦
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HTTPSIG_KEYID, char *keyid);
πΈ DESCRIPTION πΈ
heads up bestie: this feature is experimental and may change before it's considered stable. we genuinely advise against using it in production. no cap. π
So what you do is pass a null-terminated string that identifies the key used for RFC 9421 HTTP Message Signatures. That value gets included as the keyid parameter in the Signature-Input header, which is how the server looks up the matching verification key. like a little name tag for your key π
Good news: the application does not have to keep the string around after setting this option. curl's got it, you can let it go, main character energy β¨
If you use this option multiple times, the last set string overrides the previous ones. Set it to NULL to disable its use again. simple as that π«Ά
π DEFAULT π
NULL
π PROTOCOLS π
This functionality affects http only.
π 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);
}
}
like look at that, "my-key-id" just chilling there being iconic π
β AVAILABILITY β
Added in curl 8.22.0 β a whole new era fr fr
π₯ RETURN VALUE π₯
curl_easy_setopt(3) returns a CURLcode indicating success or error.
CURLE_OK (0) means everything was OK β slay. non-zero means an error occurred, so go check libcurl-errors(3). π
π SEE ALSO π
and that's the whole vibe check bestie π§π this page came to you from libcurl, dated 2026-10-25 β go forth and sign those messages, you absolute icon π
π¦ where this page comes from
- alpine 3.23: curl-doc 8.23.0-r0 Β· curl
- alpine 3.24: curl-doc 8.23.0-r0 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms