Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Marshal ¶
Marshal encodes the value pointed to by v following the CTAP2 canonical CBOR encoding form. (https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#message-encoding)
func Unmarshal ¶
Unmarshal parses the CBOR-encoded data into the value pointed to by v following the CTAP2 canonical CBOR encoding form. (https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#message-encoding)
The data must hold exactly one CBOR item. Bytes which follow that item are malformed input rather than something to discard, so they are reported. Callers decoding an item embedded in a larger byte sequence want UnmarshalFirst.
func UnmarshalFirst ¶ added in v0.18.0
UnmarshalFirst parses the first CBOR-encoded item in data into the value pointed to by v following the CTAP2 canonical CBOR encoding form, and returns the number of bytes of data which that item consumed. Callers which decode an item embedded in a larger byte sequence must use this rather than deriving a length from the re-encoded output of Marshal, as the encoded form is not guaranteed to be the same size as the form which was decoded.
Types ¶
type RawMessage ¶ added in v0.18.0
type RawMessage = cbor.RawMessage
RawMessage is a raw encoded CBOR value, which callers can use to defer the decoding of a member whose shape depends on another member of the same structure. It is an alias so that a value of this type satisfies the underlying library's own marshalling interfaces, and exists so that consumers of this package do not have to import that library directly.