dh

package
v0.0.0-...-4dd0036 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeyExchange

func KeyExchange(dh DHPair) [32]byte

协商密钥

Types

type DHPair

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

DH秘钥交换结构体

func NewDHPair

func NewDHPair(prk, puk Key) DHPair

创建一个DH密钥对

func (DHPair) GetPrivateKey

func (this DHPair) GetPrivateKey() Key

func (DHPair) GetPublicKey

func (this DHPair) GetPublicKey() Key

type Key

type Key [32]byte

私钥和公钥

func (Key) String

func (k Key) String() string

桁条接口符合性。

type KeyPair

type KeyPair struct {
	PublicKey  Key
	PrivateKey Key
}

公钥私钥对

func GenerateKeyPair

func GenerateKeyPair(rand []byte) (KeyPair, error)

生成公钥私钥对

func (KeyPair) GetPrivateKey

func (this KeyPair) GetPrivateKey() Key

func (KeyPair) GetPublicKey

func (this KeyPair) GetPublicKey() Key

Jump to

Keyboard shortcuts

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