ecdh

package
v1.0.1020 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ecdh

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

ecdh

func New

func New(curve string) Ecdh

构造函数 可选 [P521 | P384 | P256 | P224]

func (Ecdh) Check

func (this Ecdh) Check(peersPublic PublicKey) (err error)

检测

func (Ecdh) ComputeSecret

func (this Ecdh) ComputeSecret(private PrivateKey, peersPublic PublicKey) (secret []byte)

生成密码

func (Ecdh) GenerateKey

func (this Ecdh) GenerateKey(rand io.Reader) (private PrivateKey, public PublicKey, err error)

生成密钥对

func (Ecdh) PublicKey

func (this Ecdh) PublicKey(private PrivateKey) (public PublicKey)

生成公钥

type PrivateKey

type PrivateKey []byte

私钥

type PublicKey

type PublicKey []byte

公钥

Jump to

Keyboard shortcuts

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