Documentation
¶
Overview ¶
Package phonepair implements wing-scoped, two-sided phone enrollment and control.
Index ¶
- Constants
- func CheckEmoji(key []byte) string
- func DiscoveryName(wingID string) string
- func EmojiFromShared(q Invitation, shared []byte, alice, bob string) string
- func Fingerprint(key string) string
- func Identity(q Invitation) string
- func PairKey(q Invitation, shared []byte, alice, bob string) (cipher.AEAD, error)
- type Control
- type Device
- type Handler
- type Invitation
- type Manager
- func (m *Manager) Allow(id string) error
- func (m *Manager) Box(ctx context.Context, r Request) Response
- func (m *Manager) Cancel(id string) error
- func (m *Manager) Close()
- func (m *Manager) Create() (Invitation, error)
- func (m *Manager) Devices() []Device
- func (m *Manager) Handle(ctx context.Context, r Request) Response
- func (m *Manager) Revoke(name string) error
- func (m *Manager) Status(id string) (PairStatus, error)
- type PairStatus
- type Request
- type Response
- type Server
Constants ¶
View Source
const Lifetime = 5 * time.Minute
View Source
const MaxPayload = 256 << 10
Variables ¶
This section is empty.
Functions ¶
func CheckEmoji ¶
func DiscoveryName ¶
DiscoveryName identifies one wing, not a display name or another machine.
func EmojiFromShared ¶
func EmojiFromShared(q Invitation, shared []byte, alice, bob string) string
EmojiFromShared repeats the domain-separated HKDF so callers need not expose cipher internals.
func Fingerprint ¶
func Identity ¶
func Identity(q Invitation) string
Types ¶
type Invitation ¶
type Invitation struct {
Version int `json:"v"`
WingID string `json:"wing_id"`
Name string `json:"name"`
Key string `json:"key"`
Local string `json:"local"`
Endpoints []string `json:"endpoints,omitempty"`
Relay string `json:"relay"`
ID string `json:"id"`
Secret string `json:"secret"`
ExpiresAt time.Time `json:"expires_at"`
}
func (Invitation) Link ¶
func (q Invitation) Link() string
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) Box ¶
Box encrypts the entire phone protocol, including PAKE public messages and errors, to the QR-pinned wing key before it enters an untrusted carrier.
func (*Manager) Create ¶
func (m *Manager) Create() (Invitation, error)
type PairStatus ¶
type Response ¶
type Response struct {
Error string `json:"error,omitempty"`
Message string `json:"message,omitempty"`
Key string `json:"key,omitempty"`
Name string `json:"name,omitempty"`
ExpiresAt time.Time `json:"expires_at,omitempty"`
ConnectionID string `json:"connection_id,omitempty"`
Payload string `json:"payload,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.