veraison / go-cose

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

Improve Algorithm.String() message for unknown values #167

Closed qmuntal closed 1 year ago

qmuntal commented 1 year ago

This PR modifies the Algorithm.String message for values not defined in go-cose.

For example, when calling Algorithm(7).String(), it previously returned unknown algorithm value 7. Considering that other libraries can define their own algorithms, IMO that message is too verbose and seems more like an error than a useful name. With the new behavior, the returned string will be Algorithm(7).

While here, fix #164.

SteveLasker commented 1 year ago

Thanks @hslatman for the initial PR.