Documentation ¶
Overview ¶
Package hsm is used to interact with chains with a HSM it is currently not used
Index ¶
- func GenerateKey(label string, algorithm keystone.KeygenAlgorithm, config *crypto11.Config) (*keystone.CryptoKey, error)
- func GetHSMAddress(config *crypto11.Config, label string) (types.Address, types.PubKey, error)
- func GetPKCS11Config() (config *crypto11.Config, err error)
- func Sign(config *crypto11.Config, msg []byte, label string) (signature []byte, err error)
- func SignWithHSM(txf clienttx.Factory, name string, txBuilder client.TxBuilder, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateKey ¶
func GenerateKey( label string, algorithm keystone.KeygenAlgorithm, config *crypto11.Config, ) (*keystone.CryptoKey, error)
GenerateKey This generates a new key using one of the supported algorithms and a label identifier through the HSM
func GetHSMAddress ¶
GetHSMAddress This address is generated by secp256k1 curve from cosmos sdk
func GetPKCS11Config ¶
GetPKCS11Config returns the PKCS11 configuration from the environment variables
func Sign ¶
Sign Generates signature of msg using the key indexed by the label through the HSM defined in the config
func SignWithHSM ¶
func SignWithHSM( txf clienttx.Factory, name string, txBuilder client.TxBuilder, overwriteSig bool, txConfig client.TxConfig, ) error
SignWithHSM signs a given tx with a named key. This is adapted from github.com/cosmos/cosmos-sdk/client/tx Sign() function; Modified to use an HSM. The resulting signature will be added to the transaction builder overwriting the previous ones if overwrite=true (otherwise, the signature will be appended). Signing a transaction with multiple signers in the DIRECT mode is not supported and will return an error. An error is returned upon failure.
Types ¶
This section is empty.