peteroupc / CBOR

A C# implementation of Concise Binary Object Representation (RFC 8949).
The Unlicense
206 stars 29 forks source link

How do i check if cbor byte is canonically correct? #75

Closed nooobcoder closed 8 months ago

nooobcoder commented 8 months ago

If i have a byte array of cbor data, how do i check if it is canonically correct (nested to n levels)?

nooobcoder commented 8 months ago

Edit:

CBORObject parsedData = CBORObject.DecodeFromBytes(resData, new CBOREncodeOptions("ctap2canonical=1"));

I found out how this could be achieved, any chance you can include this as an example in the readme?