smp

package
v0.0.0-...-5b0cdd0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2021 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JustWorks = iota
	NumericComp
	Passkey
	Oob
)

Variables

This section is empty.

Functions

func GenerateSecret

func GenerateSecret(prv crypto.PrivateKey, pub crypto.PublicKey) ([]byte, error)

func MarshalPublicKeyX

func MarshalPublicKeyX(k crypto.PublicKey) []byte

func MarshalPublicKeyXY

func MarshalPublicKeyXY(k crypto.PublicKey) []byte

func NewSmpFactory

func NewSmpFactory(bm hci.BondManager) *factory

func NewSmpManager

func NewSmpManager(config hci.SmpConfig, bm hci.BondManager) *manager

todo: need to have on instance per connection which requires a mutex in the bond manager todo: remove bond manager from input parameters?

func NewSmpTransport

func NewSmpTransport(ctx *pairingContext, bm hci.BondManager, e hci.Encrypter, writePDU func([]byte) (int, error), nopFunc func() error) *transport

func UnmarshalPublicKey

func UnmarshalPublicKey(b []byte) (crypto.PublicKey, bool)

Types

type ECDHKeys

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

func GenerateKeys

func GenerateKeys() (*ECDHKeys, error)

type PairingState

type PairingState int
const (
	Init PairingState = iota
	WaitPairingResponse
	WaitPublicKey
	WaitConfirm
	WaitRandom
	WaitDhKeyCheck
	Finished
	Error
)

Jump to

Keyboard shortcuts

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