profile

package
v0.0.0-...-3df9379 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PeerProfile

type PeerProfile struct {
	WireguardIP net.IP `json:"wireguard_ip"`
	PublicKey   string `json:"public_key"`
}

type Profile

type Profile struct {
	WireguardIP      net.IP   `json:"wireguard_ip"`
	WireguardNetmask int      `json:"wireguard_netmask"`
	PublicKey        string   `json:"public_key"`
	PrivateKey       string   `json:"private_key"`
	AllowedPeers     []string `json:"allowed_peers"`
}

func (*Profile) DoServerChallenge

func (p *Profile) DoServerChallenge(profile *Profile) string

func (*Profile) FillProfileFromServer

func (p *Profile) FillProfileFromServer()

func (*Profile) GetPeerProfile

func (p *Profile) GetPeerProfile(id string) (PeerProfile, error)

func (*Profile) GetServerChallenge

func (p *Profile) GetServerChallenge(profile *Profile) (ServerChallenge, error)

func (*Profile) SetupWireguard

func (p *Profile) SetupWireguard(device *device.Device, WGInterface string)

type ServerChallenge

type ServerChallenge struct {
	Challenge      string `json:"challenge"`
	PublicKey      string `json:"public_key"`
	BytesChallenge []byte
	BytesPublicKey [32]byte
}

func (*ServerChallenge) Decrypt

func (sc *ServerChallenge) Decrypt(privateKey [32]byte) ([]byte, error)

func (*ServerChallenge) Encrypt

func (sc *ServerChallenge) Encrypt(privateKey [32]byte, message []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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