diff --git a/README.md b/README.md index 70532e7..7d3f814 100644 --- a/README.md +++ b/README.md @@ -14,18 +14,14 @@ in the [API reference](https://pkg.go.dev/github.com/yaronf/httpsign). ```cgo // Create a signer and a wrapped HTTP client - signer, _ := httpsign.NewRSAPSSSigner("key1", *prvKey, - httpsign.NewSignConfig(), + signer, _ := httpsign.NewRSAPSSSigner(*prvKey, httpsign.NewSignConfig(), httpsign.Headers("@request-target", "content-digest")) // The Content-Digest header will be auto-generated client := httpsign.NewDefaultClient(httpsign.NewClientConfig().SetSignatureName("sig1").SetSigner(signer)) // sign requests, don't verify responses // Send an HTTP POST, get response -- signing happens behind the scenes body := `{"hello": "world"}` - res, err := client.Post(ts.URL, "application/json", bufio.NewReader(strings.NewReader(body))) - if err != nil { - // handle error - } - + res, _ := client.Post(ts.URL, "application/json", bufio.NewReader(strings.NewReader(body))) + // Read the response serverText, _ := io.ReadAll(res.Body) _ = res.Body.Close() diff --git a/doc.go b/doc.go index 2273757..3fc0fea 100644 --- a/doc.go +++ b/doc.go @@ -1,5 +1,4 @@ -// Package httpsign signs HTTP requests and responses as defined in draft-ietf-httpbis-message-signatures. -// See https://datatracker.ietf.org/doc/draft-ietf-httpbis-message-signatures/ for the latest draft version. +// Package httpsign signs HTTP requests and responses as defined in RFC 9421, formerly draft-ietf-httpbis-message-signatures. // // For client-side message signing and verification, use the Client wrapper. // Alternatively you can use SignRequest, VerifyResponse etc. directly, but this is more complicated.