kmswallet

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKMSClient

func GetKMSClient(secretId string, secretKey string, region string, endpoint string) *kms.Client

func SigDigest

func SigDigest(chainID, payload, contextFreeData []byte) []byte

Types

type TencentKMSKeyBag

type TencentKMSKeyBag struct {
	Keys                []*ecc.PrivateKey `json:"keys"`
	PublicKeyToKMSIdMap map[string]string `json:"publicKeyToKMSIdMap"`
	KMSClient           *kms.Client
}

func NewTencentKMSKeyBag

func NewTencentKMSKeyBag(client *kms.Client) *TencentKMSKeyBag

func (*TencentKMSKeyBag) Add

func (b *TencentKMSKeyBag) Add(wifKey string) error

func (*TencentKMSKeyBag) AddKMSKeyById

func (b *TencentKMSKeyBag) AddKMSKeyById(kmsId string) (string, error)

func (*TencentKMSKeyBag) Append

func (b *TencentKMSKeyBag) Append(privateKey *ecc.PrivateKey) error

func (*TencentKMSKeyBag) AvailableKeys

func (b *TencentKMSKeyBag) AvailableKeys(ctx context.Context) (out []ecc.PublicKey, err error)

func (*TencentKMSKeyBag) ImportFromFile

func (b *TencentKMSKeyBag) ImportFromFile(path string) error

func (*TencentKMSKeyBag) ImportPrivateKey

func (b *TencentKMSKeyBag) ImportPrivateKey(ctx context.Context, wifPrivKey string) (err error)

func (*TencentKMSKeyBag) ImportPrivateKeyFromEnv

func (b *TencentKMSKeyBag) ImportPrivateKeyFromEnv(ctx context.Context, envVarName string) error

func (*TencentKMSKeyBag) Sign

func (b *TencentKMSKeyBag) Sign(ctx context.Context, tx *zsw.SignedTransaction, chainID []byte, requiredKeys ...ecc.PublicKey) (*zsw.SignedTransaction, error)

func (*TencentKMSKeyBag) SignDigest

func (b *TencentKMSKeyBag) SignDigest(digest []byte, requiredKey ecc.PublicKey) (ecc.Signature, error)

Jump to

Keyboard shortcuts

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