encrypt

package
v0.0.0-...-3a41573 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EncryptAlg

type EncryptAlg interface {
	PubEncrypt([]byte) (string, error)
	PriEncrypt([]byte) (string, error)
	PriDecrypt(string) ([]byte, error)
	PubDecrypt(string) ([]byte, error)
	PriEncryptSign([]byte) (string, error) //加密,加盐,hash后签名,出结果
	VerifySign([]byte, string) error
}

输出结果都是base64编码的字串

func GetDefaultRsaAlg

func GetDefaultRsaAlg() (EncryptAlg, error)

func NewRsaEncrypt

func NewRsaEncrypt(pemBytes []byte) (EncryptAlg, error)

type EncryptKey

type EncryptKey interface {
	HasPublic() bool
	HasPrivate() bool
	GetPrivPEM() string
	GetPubPEM() string
	GetPrivKey() interface{}
	GetPubKey() interface{}
}

func NewRsaKey

func NewRsaKey(pemBytes []byte) (EncryptKey, error)

Jump to

Keyboard shortcuts

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