handler

package
v0.0.0-...-e391cb3 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2016 License: MIT Imports: 12 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCryptoClient

func NewCryptoClient(device *gorpc.Device, dhKey *DHKey) gorpc.Handler

NewCryptoClient .

func NewCryptoServer

func NewCryptoServer(resovler DHKeyResolver) gorpc.Handler

NewCryptoServer .

func NewHeartbeatHandler

func NewHeartbeatHandler(timeout time.Duration) gorpc.Handler

NewHeartbeatHandler create new heartbeat handler

func NewStateHandler

func NewStateHandler(f StateF) gorpc.Handler

NewStateHandler .

func PKCS5Padding

func PKCS5Padding(ciphertext []byte, blockSize int) []byte

PKCS5Padding .

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) []byte

PKCS5UnPadding .

Types

type CryptoServer

type CryptoServer interface {
	GetDevice() *gorpc.Device
}

CryptoServer .

type DHKey

type DHKey struct {
	// contains filtered or unexported fields
}

DHKey 通过Diffie-Hellman算法生成共享密钥

func NewDHKey

func NewDHKey(G, P *big.Int) *DHKey

NewDHKey 生成新的DH密钥对象

func (*DHKey) Exchange

func (key *DHKey) Exchange() *big.Int

Exchange 获取交换密钥

func (*DHKey) Gen

func (key *DHKey) Gen(E *big.Int) *big.Int

Gen 生成共享密钥

func (*DHKey) String

func (key *DHKey) String() string

String 实现ToString接口

type DHKeyResolve

type DHKeyResolve func(device *gorpc.Device) (*DHKey, error)

DHKeyResolve .

func (DHKeyResolve) Resolve

func (resolve DHKeyResolve) Resolve(device *gorpc.Device) (*DHKey, error)

Resolve .

type DHKeyResolver

type DHKeyResolver interface {
	Resolve(device *gorpc.Device) (*DHKey, error)
}

DHKeyResolver .

type StateF

type StateF func(pipeline gorpc.Pipeline, state gorpc.State)

StateF state event callback

Jump to

Keyboard shortcuts

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