cbor

package
v1.0.0-dev.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package cbor decodes the RFC 8949 data items WebAuthn carries: one item per call, bounded in size, depth and item count, with no indefinite lengths or tags. Integer width and map key order are not checked (WebAuthn §2.4's canonical form): values are compared, never encodings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Value

type Value struct {
	// contains filtered or unexported fields
}

Value is one decoded data item.

func Decode

func Decode(data []byte) (Value, []byte, error)

Decode reads one data item from data and returns the bytes after it. Byte and text strings in the value alias data. Every refusal is one of the package's errors, and nothing sized by the input is allocated before the item is known to be well-formed and within bounds.

func (Value) Bytes

func (v Value) Bytes() ([]byte, bool)

Bytes returns a byte string, aliasing the decoded input.

func (Value) Int

func (v Value) Int() (int64, bool)

Int returns an unsigned or negative integer.

func (Value) Map

func (v Value) Map() (iter.Seq2[Value, Value], bool)

Map returns a map's entries in input order.

func (Value) Text

func (v Value) Text() (string, bool)

Text returns a text string.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL