B.2.5. Firma di una richiesta con hmac-sha256 (Signing a Request Using hmac-sha256)
B.2.5. Firma di una richiesta con hmac-sha256 (Signing a Request Using hmac-sha256)
Questo esempio copre porzioni del messaggio test-request usando l'algoritmo hmac-sha256 e il segreto test-shared-secret.
La corrispondente base della firma è:
NOTA: a capo con '' secondo RFC 8792
"date": Tue, 20 Apr 2021 02:07:55 GMT
"@authority": example.com
"content-type": application/json
"@signature-params": ("date" "@authority" "content-type")
;created=1618884473;keyid="test-shared-secret"
Ne consegue che al messaggio vengono aggiunti i seguenti campi Signature-Input e Signature con l'etichetta sig-b25:
NOTA: a capo con '' secondo RFC 8792
Signature-Input: sig-b25=("date" "@authority" "content-type")
;created=1618884473;keyid="test-shared-secret"
Signature: sig-b25=:pxcQw6G3AjtMBQjwo8XzkZf/bws5LelbaMk5rGIGtE8=:
Prima di usare in pratica firme simmetriche, si veda la discussione sui compromessi di sicurezza nella Sezione 7.3.3.