veraison / go-cose

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

Make ToBeSigned publically accessible #177

Closed honourfish closed 10 months ago

honourfish commented 11 months ago

What is the areas you would like to add the new feature to?

Go-COSE Library

Is your feature request related to a problem?

The cloud Key Management service I am using does NOT allow exporting of private key data.

In order to create the signature for the cose_sign1 message I have to go through my cloud Key Management API.

Therefore I need the cose ToBeSigned to pass to my cloud Key Management API.

What solution do you propose?

Be able to get cose ToBeSigned from a cose_sign1 struct.

What alternatives have you considered?

local implementation that generates cose ToBeSigned from the cose_sign1 struct

Any additional context?

No response

OR13 commented 10 months ago

Recommend to link to documentation on using custom signers, and close the issue as "asked, and answered".

qmuntal commented 10 months ago

Hi @honourfish. cose.Sign1Message.Sign already supports custom signers via the signer parameter, which can be anything that implements the cose.Signer interface.

Note that the cose.Signer is called with the ToBeSigned passed in the content parameter, so you can already pass ToBeSigned to whatever cloud KMS you want.

OR13 commented 10 months ago

I'm closing this issue, but if the answer above is not sufficient, please feel free to reopen.

honourfish commented 10 months ago

@qmuntal Yes thank you :) I missed the cose.Signer interface, I will use that for my KMS signing