cmw

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: Apache-2.0 Imports: 6 Imported by: 2

README

RATS Conceptual Message Wrappers

Package cmw is a golang implementation of draft-ietf-rats-msg-wrap.

Documentation

Overview

auto-generated (see utils/README.md)

Index

Constants

View Source
const (
	JSONArray = Serialization(iota)
	CBORArray
	CBORTag
	Unknown
)
View Source
const (
	ReferenceValues = 1 << iota
	Endorsements
	Evidence
	AttestationResults
	TrustAnchors
)
View Source
const (
	CfMin = uint16(0)
	CfMax = uint16(65024)
)
View Source
const (
	TnMin = uint64(1668546817)
	TnMax = uint64(1668612095)
)
View Source
const IndicatorNone = 0

Variables

This section is empty.

Functions

func CF

func CF(tn uint64) (uint16, error)

CoAP Content-Format from number CBOR Tag number

func TN

func TN(cf uint16) uint64

CBOR Tag number from CoAP Content-Format number

Types

type CMW

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

a CMW object holds the internal representation of a RATS conceptual message wrapper

func (*CMW) Deserialize

func (o *CMW) Deserialize(b []byte) error

Deserialize a CMW

func (CMW) GetIndicator

func (o CMW) GetIndicator() Indicator

func (CMW) GetType

func (o CMW) GetType() string

func (CMW) GetValue

func (o CMW) GetValue() []byte

func (CMW) MarshalCBOR

func (o CMW) MarshalCBOR() ([]byte, error)

func (CMW) MarshalCBORTag

func (o CMW) MarshalCBORTag() ([]byte, error)

func (CMW) MarshalJSON

func (o CMW) MarshalJSON() ([]byte, error)

func (CMW) Serialize

func (o CMW) Serialize(s Serialization) ([]byte, error)

Serialize a CMW according to the provided Serialization

func (*CMW) SetContentFormat

func (o *CMW) SetContentFormat(v uint16)

func (*CMW) SetIndicators

func (o *CMW) SetIndicators(indicators ...Indicator)

func (*CMW) SetMediaType

func (o *CMW) SetMediaType(v string)

func (*CMW) SetTagNumber

func (o *CMW) SetTagNumber(v uint64)

func (*CMW) SetValue

func (o *CMW) SetValue(v []byte)

func (*CMW) UnmarshalCBOR

func (o *CMW) UnmarshalCBOR(b []byte) error

func (*CMW) UnmarshalCBORTag

func (o *CMW) UnmarshalCBORTag(b []byte) error

func (*CMW) UnmarshalJSON

func (o *CMW) UnmarshalJSON(b []byte) error

type Indicator

type Indicator uint

Indicator is the internal representation of the `cm-ind` bit map

func (*Indicator) Clear

func (o *Indicator) Clear(v Indicator)

func (Indicator) Empty

func (o Indicator) Empty() bool

func (Indicator) Has

func (o Indicator) Has(v Indicator) bool

func (*Indicator) Set

func (o *Indicator) Set(v Indicator)

func (*Indicator) Toggle

func (o *Indicator) Toggle(v Indicator)

type Serialization

type Serialization uint

type Type

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

func (Type) IsSet

func (o Type) IsSet() bool

func (Type) MarshalCBOR

func (o Type) MarshalCBOR() ([]byte, error)

func (Type) MarshalJSON

func (o Type) MarshalJSON() ([]byte, error)

func (*Type) Set

func (o *Type) Set(v any) error

func (Type) String

func (o Type) String() string

func (Type) TagNumber

func (o Type) TagNumber() (uint64, error)

func (*Type) UnmarshalCBOR

func (o *Type) UnmarshalCBOR(b []byte) error

func (*Type) UnmarshalJSON

func (o *Type) UnmarshalJSON(b []byte) error

type Value

type Value []byte

func (Value) IsSet

func (o Value) IsSet() bool

func (Value) MarshalCBOR

func (o Value) MarshalCBOR() ([]byte, error)

func (Value) MarshalJSON

func (o Value) MarshalJSON() ([]byte, error)

func (*Value) Set

func (o *Value) Set(v []byte) error

func (*Value) UnmarshalCBOR

func (o *Value) UnmarshalCBOR(b []byte) error

func (*Value) UnmarshalJSON

func (o *Value) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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