utils

package
v0.0.0-...-b9cfb1f Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2019 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructEncryptionJwt

func ConstructEncryptionJwt(key *ecdsa.PrivateKey, token []byte) string

func DecodeJwt

func DecodeJwt(v string) []string

func DecodeJwtPayload

func DecodeJwtPayload(v string, t interface{})

Types

type EncryptionData

type EncryptionData struct {
	ClientPublicKey       *ecdsa.PublicKey
	ServerPrivateKey      *ecdsa.PrivateKey
	ServerToken           []byte
	SharedSecret          []byte
	DecryptSecretKeyBytes [32]byte
	EncryptSecretKeyBytes [32]byte

	DecryptIV     []byte
	EncryptIV     []byte
	DecryptCipher cipher.Block
	EncryptCipher cipher.Block

	SendCounter int64
}

func (*EncryptionData) ComputeSecretKeyBytes

func (data *EncryptionData) ComputeSecretKeyBytes()

func (*EncryptionData) ComputeSharedSecret

func (data *EncryptionData) ComputeSharedSecret()

type EncryptionHandler

type EncryptionHandler struct {
	Data *EncryptionData
}

func NewEncryptionHandler

func NewEncryptionHandler() *EncryptionHandler

func (*EncryptionHandler) ComputeSendChecksum

func (handler *EncryptionHandler) ComputeSendChecksum(d []byte) []byte

type EncryptionHeader

type EncryptionHeader struct {
	Algorithm string `json:"alg"`
	X5u       string `json:"x5u"`
}

type EncryptionPayload

type EncryptionPayload struct {
	Token string `json:"salt"`
}

Jump to

Keyboard shortcuts

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