util

package
v0.0.0-...-1bfa26d Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2018 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildUrlCode

func BuildUrlCode(mp map[string]string) string

func CurTimeStamp

func CurTimeStamp() string

用时间戳生成随机字符串

func GenRsaKey

func GenRsaKey(bits int) ([]byte, []byte)

func NewHttpsClient

func NewHttpsClient(cert *tls.Certificate) *http.Client

func NewrsaClient

func NewrsaClient() *rsaClient

func NonceStr

func NonceStr(length int) string

生成随机字符串

Types

type Sign_Type

type Sign_Type int
const (
	SIGN_TYPE_ECC Sign_Type = 1 + iota
	SIGN_TYPE_RSA
)

type Signer

type Signer interface {
	Sign(src []byte) ([]byte, error)
	Verify(src []byte, sign []byte) error
	SetPrivKey(privatekey []byte) error
	SetPubKey(publickey []byte) error
}

func NewFromPem

func NewFromPem(key string, t Sign_Type) (Signer, error)

Jump to

Keyboard shortcuts

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