Versions in this module Expand all Collapse all v0 v0.2.1 Nov 2, 2026 v0.2.0 Nov 2, 2026 Changes in this version + var ErrWrongState = errors.New("edhoc: method called in the wrong state") + func CoAPMessage1(msg []byte) []byte + func CoAPRequest(cR, msg []byte) []byte + func ParseCoAPRequest(payload []byte) (cR, msg []byte, message1 bool, err error) type Config + GetConfig func(ctx context.Context, m *Message1Info) (*Config, error) + type ErrCode int + func (c ErrCode) String() string type Error + Info string + type Message1Info struct + EAD []EAD + Method Method + PeerConnID []byte + Suite Suite + Suites []Suite type Method + func (m Method) String() string + type OSCOREParams struct + AEADAlg int + HashAlg int + MasterSalt []byte + MasterSecret []byte + RecipientID []byte + SenderID []byte + type PeerInfo struct + ConnID []byte + EAD []EAD + ID IDCred + PeerConnID []byte type Session + func (s *Session) Close() type Suite + func (s Suite) String() string v0.1.0 Nov 2, 2026 Changes in this version + const ErrCodeUnknownCredential + const ErrCodeUnspecified + const ErrCodeWrongSelectedSuite + var ErrUnknownCredential = errors.New("edhoc: unknown credential") + func ErrorMessage(err error) []byte + type Config struct + ConnID []byte + Credential Credential + EADLabels []int + Key any + Method Method + PeerCredential func(id IDCred) (Credential, error) + PeerSuites []Suite + Suites []Suite + type Credential struct + ID IDCred + PublicKey crypto.PublicKey + Raw []byte + func NewCCS(subject string, kid []byte, pub crypto.PublicKey) (Credential, error) + func NewX509(der []byte) (Credential, error) + func ParseCCS(ccs []byte) (Credential, error) + type DHKey interface + ECDH func(remote *ecdh.PublicKey) ([]byte, error) + PublicKey func() *ecdh.PublicKey + type EAD struct + Label int + Value []byte + type Error struct + Code int + Suites []Suite + func (e *Error) Error() string + func (e *Error) Unwrap() error + type IDCred struct + func KCCS(ccs []byte) IDCred + func KeyID(kid []byte) IDCred + func ParseIDCred(raw []byte) (IDCred, error) + func X5Chain(certs ...[]byte) IDCred + func X5T(der []byte) IDCred + func (id IDCred) Bytes() []byte + func (id IDCred) Equal(other IDCred) bool + func (id IDCred) KCCS() ([]byte, bool) + func (id IDCred) KeyID() ([]byte, bool) + func (id IDCred) X5Chain() ([][]byte, bool) + type Initiator struct + func NewInitiator(cfg *Config) (*Initiator, error) + func (i *Initiator) PeerCredential() Credential + func (i *Initiator) PeerEAD() []EAD + func (i *Initiator) ReadMessage2(msg []byte) error + func (i *Initiator) ReadMessage4(msg []byte) error + func (i *Initiator) Session() (*Session, error) + func (i *Initiator) WriteMessage1(ead ...EAD) ([]byte, error) + func (i *Initiator) WriteMessage3(ead ...EAD) ([]byte, error) + type Method int + const MethodSignSign + const MethodSignStatic + const MethodStaticSign + const MethodStaticStatic + type OSCOREContext struct + AEADAlg int + HashAlg int + MasterSalt []byte + MasterSecret []byte + RecipientID []byte + SenderID []byte + type PeerError struct + Code int + Info string + Suites []Suite + func (e *PeerError) Error() string + type Responder struct + func NewResponder(cfg *Config) (*Responder, error) + func (r *Responder) PeerCredential() Credential + func (r *Responder) PeerEAD() []EAD + func (r *Responder) ReadMessage1(msg []byte) error + func (r *Responder) ReadMessage3(msg []byte) error + func (r *Responder) Session() (*Session, error) + func (r *Responder) WriteMessage2(ead ...EAD) ([]byte, error) + func (r *Responder) WriteMessage4(ead ...EAD) ([]byte, error) + type Session struct + func (s *Session) ConnIDs() (cI, cR []byte) + func (s *Session) Exporter(label int, context []byte, length int) ([]byte, error) + func (s *Session) KeyUpdate(context []byte) error + func (s *Session) OSCORE() (*OSCOREContext, error) + func (s *Session) PeerCredential() Credential + func (s *Session) Suite() Suite + type Suite int + const Suite0 + const Suite1 + const Suite2 + const Suite24 + const Suite3 + const Suite4 + const Suite5 + const Suite6