Versions in this module Expand all Collapse all v0 v0.0.2 Aug 11, 2023 Changes in this version + var CryptoM = make(map[crypto.KeyType]*Crypto) + func ConfiguredKeyType(algorithms []string) error + func GenKeyStore(priv crypto.PrivateKey, password string) (*crypto.KeyStore, error) + func GenerateKeyPair(opt crypto.KeyType) (crypto.PrivateKey, error) + func GetConfiguredKeyType() map[crypto.KeyType]string + func PrivKeyToStdKey(priv crypto.PrivateKey) (ecdsa2.PrivateKey, error) + func PrivateKeyFromStdKey(priv crypto2.PrivateKey) (crypto.PrivateKey, error) + func PubKeyFromStdKey(pub crypto2.PublicKey) (crypto.PublicKey, error) + func PubKeyToStdKey(pub crypto.PublicKey) (crypto2.PublicKey, error) + func RegisterCrypto(typ crypto.KeyType, f CryptoConstructor, g CryptoVerify, ...) + func RestorePrivateKey(keyFilePath, password string) (crypto.PrivateKey, error) + func SignWithType(privKey crypto.PrivateKey, digest []byte) ([]byte, error) + func StorePrivateKey(priv crypto.PrivateKey, keyFilePath, password string) error + func SupportKeyType() map[crypto.KeyType]string + func SupportedKeyType(typ crypto.KeyType) bool + func Verify(opt crypto.KeyType, sig, digest []byte, from types.Address) (bool, error) + func VerifyWithType(sig, digest []byte, from types.Address) (bool, error) + type Crypto struct + Constructor CryptoConstructor + UnmarshalPrivateKey CryptoUnmarshalPrivateKey + Verify CryptoVerify + func GetCrypto(typ crypto.KeyType) (*Crypto, error) + type CryptoConstructor func(opt crypto.KeyType) (crypto.PrivateKey, error) + type CryptoUnmarshalPrivateKey func(data []byte, opt crypto.KeyType) (crypto.PrivateKey, error) + type CryptoVerify func(opt crypto.KeyType, sig, digest []byte, from types.Address) (bool, error)