crypto

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: Apache-2.0, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PubKeyFileMagicNum  = []byte{255, 112, 117, 98}
	PrivKeyFileMagicNum = []byte{0, 112, 114, 118}
)

Functions

func DecodePrivKey

func DecodePrivKey(base58PrivKey string, pwdBytes []byte) (*framework.PrivKey, error)

func DecodePrivKeyWithRawPwd

func DecodePrivKeyWithRawPwd(base58PrivKey string, pwd string) (*framework.PrivKey, error)

func DecodePubKey

func DecodePubKey(base58PubKey string) (*framework.PubKey, error)

func DecryptPrivKey

func DecryptPrivKey(encPrivKey []byte, pwdBytes []byte) ([]byte, error)

func EncodePrivKey

func EncodePrivKey(privKey *framework.PrivKey, pwdBytes []byte) (string, error)

func EncodePrivKeyWithRawPwd

func EncodePrivKeyWithRawPwd(privKey *framework.PrivKey, pwd string) (string, error)

func EncodePubKey

func EncodePubKey(pubKey *framework.PubKey) string

func EncryptPrivKey

func EncryptPrivKey(privKey *framework.PrivKey, pwdBytes []byte) ([]byte, error)

func GetAlgorithmByCode

func GetAlgorithmByCode(code int16) framework.CryptoAlgorithm

获取算法定义

func GetAlgorithmByName

func GetAlgorithmByName(name string) framework.CryptoAlgorithm

func GetAsymmetricEncryptionFunctionByCode

func GetAsymmetricEncryptionFunctionByCode(code int16) framework.AsymmetricEncryptionFunction

非对称加密算法实现

func GetAsymmetricEncryptionFunctionByName

func GetAsymmetricEncryptionFunctionByName(name string) framework.AsymmetricEncryptionFunction

func GetCryptoFunction

func GetCryptoFunction(algorithm framework.CryptoAlgorithm) framework.CryptoFunction

func GetCryptoFunctionByCode

func GetCryptoFunctionByCode(code int16) framework.CryptoFunction

密码算法实现

func GetCryptoFunctionByName

func GetCryptoFunctionByName(name string) framework.CryptoFunction

func GetHashFunction

func GetHashFunction(algorithm framework.CryptoAlgorithm) framework.HashFunction

func GetHashFunctionByCode

func GetHashFunctionByCode(code int16) framework.HashFunction

Hash算法实现

func GetHashFunctionByName

func GetHashFunctionByName(name string) framework.HashFunction

func GetRandomFunction

func GetRandomFunction(algorithm framework.CryptoAlgorithm) framework.RandomFunction

func GetRandomFunctionByCode

func GetRandomFunctionByCode(code int16) framework.RandomFunction

随机算法实现

func GetRandomFunctionByName

func GetRandomFunctionByName(name string) framework.RandomFunction

func GetSignatureFunction

func GetSignatureFunction(algorithm framework.CryptoAlgorithm) framework.SignatureFunction

func GetSignatureFunctionByCode

func GetSignatureFunctionByCode(code int16) framework.SignatureFunction

签名算法实现

func GetSignatureFunctionByName

func GetSignatureFunctionByName(name string) framework.SignatureFunction

func GetSymmetricEncryptionFunctionByCode

func GetSymmetricEncryptionFunctionByCode(code int16) framework.SymmetricEncryptionFunction

对称加密算法

func GetSymmetricEncryptionFunctionByName

func GetSymmetricEncryptionFunctionByName(name string) framework.SymmetricEncryptionFunction

func MustDecodePrivKey added in v1.3.3

func MustDecodePrivKey(base58PrivKey string, pwdBytes []byte) *framework.PrivKey

func MustDecodePubKey added in v1.3.3

func MustDecodePubKey(base58PubKey string) *framework.PubKey

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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