security

package
v0.0.0-...-a16d91a Latest Latest
Warning

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

Go to latest
Published: May 21, 2018 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyOrigin

func AnyOrigin(r *http.Request) bool

AnyOrigin is a no-op to allow any origin to upgrade their request to a websocket

Types

type DeviceKey

type DeviceKey struct {
	*rsa.PublicKey
}

DeviceKey implements the Signer interface that is used to encode messages sent to the device

func ParseDeviceKey

func ParseDeviceKey(data string) (*DeviceKey, error)

ParseDeviceKey returns a parsed device key capable of encoding device messages from a hex encoded byte array

func (*DeviceKey) Sign

func (key *DeviceKey) Sign(out io.Writer, data []byte) error

Sign implements the signer interface

type ServerKey

type ServerKey struct {
	*rsa.PrivateKey
}

ServerKey objects contain the rsa private key used to secure communications w/ the api

func ReadServerKeyFromFile

func ReadServerKeyFromFile(filename string) (*ServerKey, error)

ReadServerKeyFromFile returns a new device key from a filename

func (*ServerKey) SharedSecret

func (key *ServerKey) SharedSecret() (string, error)

SharedSecret returns the string version of the rsa public key

Jump to

Keyboard shortcuts

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