crypt

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: MPL-2.0, MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Kex

func Kex(w http.ResponseWriter, r *http.Request)

Kex expects (1) intent, intentID and public key of client, (2) generates server keypair (3) generates secret key (4) store secret key in ecdhKexDerivedKey map and (5) resopods with public key received in step 2.

This handler is only to be used be client side flow i.e. kex request initiated by client. eg. device register process.

Types

type KexRequest

type KexRequest struct {
	// Intent of kex, example - KEX_EXPORT_DH, KEX_ENROL_DEVICE, KEX_HTTP_SR
	Intent string `json:"intent"`
	// IntentID is unique identifier for key exchange process. Should be trasaID in KEX_ENROL_DEVICE and sessionID in case of other intents
	IntentID string `json:"intentID"`
	// Unique id of device which is making kex request. Machine ID can be used here?
	DeviceID string `json:"deviceID"`
	// Public key of client
	PublicKey string `json:"publicKey"`
}

Jump to

Keyboard shortcuts

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