mozilla-services / go-cose

go library for CBOR Object Signing and Encryption (COSE)
Mozilla Public License 2.0
40 stars 18 forks source link

Pass io.Reader as payload for signature #57

Closed jvehent closed 2 years ago

jvehent commented 4 years ago

Signing a message currently requires copying the payload as an []byte into the cose.SignMessage.Payload field. For large payloads, this means copying large amounts of data. It also means the max size of a payload is limited by available memory.

Payloads are hashed and this can be done in chunks to avoid loading all that data into memory. Passing an io.Reader as Payload, perhaps as a PayloadReader variable, would allow the Sign() function to use that instead of the large []byte

hwine commented 2 years ago

We are no longer making changes to this repository. See README update for more information on the successor project.