util

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(file string, line int, err string) error

错误格式化

func GetKey

func GetKey(filePath string) (*pem.Block, error)

读取公钥/私钥文件,获取解码的pem块 filePath文件路径 返回pem块和错误

func GetKeyFromString

func GetKeyFromString(pubkey string) (*pem.Block, error)

读取公钥/私钥字符串,获取解码的pem块 pubkey读取公钥/私钥字符串 返回pem块和错误

func PaddingLastGroup

func PaddingLastGroup(plainText []byte, blockSize int) []byte

填充最后一组 plainText:明文 blockSize:块大小 返回:填充后的明文

func PriEcdsaToEcies

func PriEcdsaToEcies(prv *ecdsa.PrivateKey) *ecies.PrivateKey

ecdsa private key to ecies private key

func PubEcdsaToEcies

func PubEcdsaToEcies(pub *ecdsa.PublicKey) *ecies.PublicKey

ecdsa public key to ecies public key

func UnpaddingLastGroup

func UnpaddingLastGroup(plainText []byte) []byte

去掉填充 plainText:填充后的明文 返回:填充前的明文

Types

This section is empty.

Jump to

Keyboard shortcuts

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