Documentation
¶
Overview ¶
This file handles encryption and decryption of TLS
This file is for handling Peers, including pairing and storage of existing paired devices.
Index ¶
- func BeginClientPeer(certFile string, keyFile string, addr string, ...) error
- func BeginHTTP(certFile string, keyFile string, addr string, ...) error
- func DecodeB64(in string) (string, error)
- func EncodeB64(in string) string
- func GenerateUUID() string
- func PCVerifyConnection(rawCerts [][]byte, knownCerts func(peerUuid string) (peerCert string)) error
- type JSONBundle
- type SelfIDs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BeginClientPeer ¶
func GenerateUUID ¶
func GenerateUUID() string
Note: GenCerts in Encryption.go also generates the localhost UUID.
func PCVerifyConnection ¶
func PCVerifyConnection(rawCerts [][]byte, knownCerts func(peerUuid string) (peerCert string)) error
Compare the certificate received from the server with the saved certificate of this UUID. An MITM should not be possible since the server must be hosted with the same cert that signed the JSON.
Types ¶
type JSONBundle ¶
type JSONBundle struct { PubKey string // required only for initial pair, otherwise it is ignored. Test string }
func (*JSONBundle) DecodeJSON ¶
func (newPairingJSON *JSONBundle) DecodeJSON(pairingJSONstr string) error
This function unmarshals a pairing JSON string into a JSONBundle
func (*JSONBundle) GenerateJSON ¶
func (newPairingJSON *JSONBundle) GenerateJSON() (string, error)
This function generates the initial pairing JSON from a JSONBundle. It is recommended to convert the string output to base64 for pairing.
Click to show internal directories.
Click to hide internal directories.