Documentation ¶
Index ¶
- Variables
- 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
- type CryptoConstructor
- type CryptoUnmarshalPrivateKey
- type CryptoVerify
Constants ¶
This section is empty.
Variables ¶
View Source
var CryptoM = make(map[crypto.KeyType]*Crypto)
Functions ¶
func ConfiguredKeyType ¶ added in v1.20.0
func GenKeyStore ¶ added in v1.0.1
func GenerateKeyPair ¶ added in v1.0.1
func GenerateKeyPair(opt crypto.KeyType) (crypto.PrivateKey, error)
func GetConfiguredKeyType ¶ added in v1.20.0
func PrivKeyToStdKey ¶ added in v1.0.1
func PrivKeyToStdKey(priv crypto.PrivateKey) (ecdsa2.PrivateKey, error)
PrivKeyToStdKey convert our crypto private key to golang standard ecdsa private key
func PrivateKeyFromStdKey ¶ added in v1.0.1
func PrivateKeyFromStdKey(priv crypto2.PrivateKey) (crypto.PrivateKey, error)
PrivateKeyFromStdKey convert golang standard crypto key to our private key
func PubKeyFromStdKey ¶ added in v1.0.1
func PubKeyToStdKey ¶ added in v1.0.1
func RegisterCrypto ¶ added in v1.20.0
func RegisterCrypto(typ crypto.KeyType, f CryptoConstructor, g CryptoVerify, k CryptoUnmarshalPrivateKey)
func RestorePrivateKey ¶ added in v1.0.1
func RestorePrivateKey(keyFilePath, password string) (crypto.PrivateKey, error)
func SignWithType ¶ added in v1.20.0
func SignWithType(privKey crypto.PrivateKey, digest []byte) ([]byte, error)
Sign signs digest using key k and add key type flag in the beginning.
func StorePrivateKey ¶ added in v1.0.1
func StorePrivateKey(priv crypto.PrivateKey, keyFilePath, password string) error
func SupportKeyType ¶ added in v1.20.0
func SupportedKeyType ¶ added in v1.20.0
SupportedKeyType: check if configuration algorithm supported in bitxhub
Types ¶
type Crypto ¶ added in v1.20.0
type Crypto struct { Constructor CryptoConstructor Verify CryptoVerify UnmarshalPrivateKey CryptoUnmarshalPrivateKey }
type CryptoConstructor ¶ added in v1.20.0
type CryptoConstructor func(opt crypto.KeyType) (crypto.PrivateKey, error)
type CryptoUnmarshalPrivateKey ¶ added in v1.20.0
Click to show internal directories.
Click to hide internal directories.