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 ¶
func GenKeyStore ¶
func GenerateKeyPair ¶
func GenerateKeyPair(opt crypto.KeyType) (crypto.PrivateKey, error)
func GetConfiguredKeyType ¶
func PrivKeyToStdKey ¶
func PrivKeyToStdKey(priv crypto.PrivateKey) (ecdsa2.PrivateKey, error)
PrivKeyToStdKey convert our crypto private key to golang standard ecdsa private key
func PrivateKeyFromStdKey ¶
func PrivateKeyFromStdKey(priv crypto2.PrivateKey) (crypto.PrivateKey, error)
PrivateKeyFromStdKey convert golang standard crypto key to our private key
func RegisterCrypto ¶
func RegisterCrypto(typ crypto.KeyType, f CryptoConstructor, g CryptoVerify, k CryptoUnmarshalPrivateKey)
func RestorePrivateKey ¶
func RestorePrivateKey(keyFilePath, password string) (crypto.PrivateKey, error)
func SignWithType ¶
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 ¶
func StorePrivateKey(priv crypto.PrivateKey, keyFilePath, password string) error
func SupportKeyType ¶
func SupportedKeyType ¶
SupportedKeyType: check if configuration algorithm supported in axiom
Types ¶
type Crypto ¶
type Crypto struct { Constructor CryptoConstructor Verify CryptoVerify UnmarshalPrivateKey CryptoUnmarshalPrivateKey }
type CryptoConstructor ¶
type CryptoConstructor func(opt crypto.KeyType) (crypto.PrivateKey, error)
Click to show internal directories.
Click to hide internal directories.