Documentation ¶
Index ¶
- Constants
- Variables
- func Decrypt(keystr string, src []byte) (strDesc []byte, err error)
- func Encrypt(keystr string, strMsg string) ([]byte, error)
- type BaseWalletApi
- type CKeys
- type CreateKeyParams
- type ImportKeyParams
- type KeyMapType
- type ListKeysParams
- type PlainKeys
- type RemoveKeyParams
- type RespKeys
- type SignTrxParams
- type SoftWallet
- func (w *SoftWallet) CheckPassword(password string)
- func (w *SoftWallet) CopyWalletFile(destinationFilename string) bool
- func (w *SoftWallet) CreateKey(keyType string) string
- func (w *SoftWallet) EncryptKeys()
- func (w *SoftWallet) GetPrivateKey(pubkey ecc.PublicKey) ecc.PrivateKey
- func (w *SoftWallet) GetPrivateKeyFromPassword(account string, role string, password string) common.Pair
- func (w *SoftWallet) GetWalletFilename() string
- func (w *SoftWallet) ImportKey(wifKey string) bool
- func (w *SoftWallet) IsLocked() bool
- func (w *SoftWallet) IsNew() bool
- func (w *SoftWallet) ListKeys() map[ecc.PublicKey]ecc.PrivateKey
- func (w *SoftWallet) ListPublicKeys() generated.PublicKeySet
- func (w *SoftWallet) LoadWalletFile(walletFilename string) bool
- func (w *SoftWallet) Lock()
- func (w *SoftWallet) RemoveKey(key string) bool
- func (w *SoftWallet) SaveWalletFile(walletFilename string)
- func (w *SoftWallet) SetPassword(password string)
- func (w *SoftWallet) SetWalletFilename(filename string)
- func (w *SoftWallet) TrySignDigest(digest []byte, publicKey ecc.PublicKey) *ecc.Signature
- func (w *SoftWallet) Unlock(password string)
- type SoftWalletImpl
- func (w *SoftWalletImpl) CopyWalletFile(password string) bool
- func (w *SoftWalletImpl) CreateKey(keyType string) string
- func (w *SoftWalletImpl) EncryptKeys()
- func (w *SoftWalletImpl) GetPrivateKey(pubkey ecc.PublicKey) ecc.PrivateKey
- func (w *SoftWalletImpl) GetWalletFilename() string
- func (w *SoftWalletImpl) ImportKey(wifKey string) bool
- func (w *SoftWalletImpl) IsLocked() bool
- func (w *SoftWalletImpl) LoadWalletFile(walletFilename string) bool
- func (w *SoftWalletImpl) RemoveKey(key string) bool
- func (w *SoftWalletImpl) SaveWalletFile(walletFilename string)
- func (w *SoftWalletImpl) TryGetPrivateKey(id ecc.PublicKey) *ecc.PrivateKey
- func (w *SoftWalletImpl) TrySignDigest(digest []byte, publicKey ecc.PublicKey) *ecc.Signature
- type Sprivate
- type SprivateKeys
- type UnlockParams
- type WalletData
- type WalletManager
- func (wm *WalletManager) Create(name string) string
- func (wm *WalletManager) CreateKey(name, keyType string) string
- func (wm *WalletManager) GetPublicKeys() (re []string)
- func (wm *WalletManager) ImportKey(name, wifkey string)
- func (wm *WalletManager) ListKeys(name, password string) RespKeys
- func (wm *WalletManager) ListWallets() []string
- func (wm *WalletManager) Lock(name string)
- func (wm *WalletManager) LockAllwallets()
- func (wm *WalletManager) Open(name string)
- func (wm *WalletManager) RemoveKey(name, password, key string)
- func (wm *WalletManager) SetDir(path string)
- func (wm *WalletManager) SetTimeOut(t int64)
- func (wm *WalletManager) SignDigest(digest common.DigestType, key ecc.PublicKey) (sig ecc.Signature)
- func (wm *WalletManager) SignTransaction(txn *types.SignedTransaction, keys []ecc.PublicKey, chainID common.ChainIdType) *types.SignedTransaction
- func (wm *WalletManager) Unlock(name, password string)
- type WalletPlugin
- type YhCapabilities
- type YhConnector
- type YhSession
- type YubihsmApi
- type YubihsmWallet
- type YubihsmWalletImpl
Constants ¶
View Source
const WalletPlug = PluginTypeName("WalletPlugin")
Variables ¶
View Source
var ( ErrWalletLocked = errors.New("Unable to handle a locked wallet") ErrWalletNoPassword = errors.New("No password") ErrWallerInvalidPassword = errors.New("Invalid password for wallet") ErrWalletKeyExist = errors.New("Key already in wallet") )
View Source
var ( ErrWalletNotAvaliable = errors.New("You don't have any wallet") ErrWalletNotUnlocked = errors.New("You don't have any unlocked wallet!") )
View Source
var DefaultWalletFilename = ""
Functions ¶
Types ¶
type BaseWalletApi ¶
type BaseWalletApi interface { GetPrivateKey(pubkey ecc.PublicKey) ecc.PrivateKey IsLocked() bool Lock() Unlock(password string) CheckPassword(password string) SetPassword(password string) ListKeys() map[ecc.PublicKey]ecc.PrivateKey ListPublicKeys() []ecc.PublicKey ImportKey(wifKey string) bool RemoveKey(key string) bool CreateKey(keyType string) string TrySignDigest(digest []byte, publicKey ecc.PublicKey) *ecc.Signature }
type CreateKeyParams ¶
type ImportKeyParams ¶
type KeyMapType ¶
type ListKeysParams ¶
type RemoveKeyParams ¶
type RespKeys ¶
type RespKeys map[ecc.PublicKey]ecc.PrivateKey
func (RespKeys) MarshalJSON ¶
func (*RespKeys) UnmarshalJSON ¶
type SignTrxParams ¶
type SignTrxParams struct { Txn *types.SignedTransaction `json:"signed_transaction"` Keys []ecc.PublicKey `json:"keys"` ChainID common.ChainIdType `json:"id"` }
type SoftWallet ¶
type SoftWallet struct {
// contains filtered or unexported fields
}
func (*SoftWallet) CheckPassword ¶
func (w *SoftWallet) CheckPassword(password string)
func (*SoftWallet) CopyWalletFile ¶
func (w *SoftWallet) CopyWalletFile(destinationFilename string) bool
func (*SoftWallet) CreateKey ¶
func (w *SoftWallet) CreateKey(keyType string) string
func (*SoftWallet) EncryptKeys ¶
func (w *SoftWallet) EncryptKeys()
func (*SoftWallet) GetPrivateKey ¶
func (w *SoftWallet) GetPrivateKey(pubkey ecc.PublicKey) ecc.PrivateKey
func (*SoftWallet) GetPrivateKeyFromPassword ¶
func (*SoftWallet) GetWalletFilename ¶
func (w *SoftWallet) GetWalletFilename() string
func (*SoftWallet) ImportKey ¶
func (w *SoftWallet) ImportKey(wifKey string) bool
func (*SoftWallet) IsLocked ¶
func (w *SoftWallet) IsLocked() bool
func (*SoftWallet) IsNew ¶
func (w *SoftWallet) IsNew() bool
func (*SoftWallet) ListKeys ¶
func (w *SoftWallet) ListKeys() map[ecc.PublicKey]ecc.PrivateKey
func (*SoftWallet) ListPublicKeys ¶
func (w *SoftWallet) ListPublicKeys() generated.PublicKeySet
func (*SoftWallet) LoadWalletFile ¶
func (w *SoftWallet) LoadWalletFile(walletFilename string) bool
func (*SoftWallet) Lock ¶
func (w *SoftWallet) Lock()
func (*SoftWallet) RemoveKey ¶
func (w *SoftWallet) RemoveKey(key string) bool
func (*SoftWallet) SaveWalletFile ¶
func (w *SoftWallet) SaveWalletFile(walletFilename string)
func (*SoftWallet) SetPassword ¶
func (w *SoftWallet) SetPassword(password string)
SetPassword Sets a new password on the wallet
func (*SoftWallet) SetWalletFilename ¶
func (w *SoftWallet) SetWalletFilename(filename string)
func (*SoftWallet) TrySignDigest ¶
func (*SoftWallet) Unlock ¶
func (w *SoftWallet) Unlock(password string)
type SoftWalletImpl ¶
type SoftWalletImpl struct { WalletFilename string Wallet WalletData Keys map[ecc.PublicKey]ecc.PrivateKey Checksum []byte }
func (*SoftWalletImpl) CopyWalletFile ¶
func (w *SoftWalletImpl) CopyWalletFile(password string) bool
func (*SoftWalletImpl) CreateKey ¶
func (w *SoftWalletImpl) CreateKey(keyType string) string
func (*SoftWalletImpl) EncryptKeys ¶
func (w *SoftWalletImpl) EncryptKeys()
func (*SoftWalletImpl) GetPrivateKey ¶
func (w *SoftWalletImpl) GetPrivateKey(pubkey ecc.PublicKey) ecc.PrivateKey
func (*SoftWalletImpl) GetWalletFilename ¶
func (w *SoftWalletImpl) GetWalletFilename() string
func (*SoftWalletImpl) ImportKey ¶
func (w *SoftWalletImpl) ImportKey(wifKey string) bool
func (*SoftWalletImpl) IsLocked ¶
func (w *SoftWalletImpl) IsLocked() bool
func (*SoftWalletImpl) LoadWalletFile ¶
func (w *SoftWalletImpl) LoadWalletFile(walletFilename string) bool
func (*SoftWalletImpl) RemoveKey ¶
func (w *SoftWalletImpl) RemoveKey(key string) bool
func (*SoftWalletImpl) SaveWalletFile ¶
func (w *SoftWalletImpl) SaveWalletFile(walletFilename string)
func (*SoftWalletImpl) TryGetPrivateKey ¶
func (w *SoftWalletImpl) TryGetPrivateKey(id ecc.PublicKey) *ecc.PrivateKey
func (*SoftWalletImpl) TrySignDigest ¶
type UnlockParams ¶
type WalletData ¶
type WalletData struct {
CipherKeys CKeys `json:"cipher_keys"` /** encrypted keys */
}
type WalletManager ¶
type WalletManager struct { Self *WalletPlugin Wallets map[string]*SoftWallet // contains filtered or unexported fields }
func (*WalletManager) Create ¶
func (wm *WalletManager) Create(name string) string
func (*WalletManager) CreateKey ¶
func (wm *WalletManager) CreateKey(name, keyType string) string
func (*WalletManager) GetPublicKeys ¶
func (wm *WalletManager) GetPublicKeys() (re []string)
func (*WalletManager) ImportKey ¶
func (wm *WalletManager) ImportKey(name, wifkey string)
func (*WalletManager) ListKeys ¶
func (wm *WalletManager) ListKeys(name, password string) RespKeys
func (*WalletManager) ListWallets ¶
func (wm *WalletManager) ListWallets() []string
func (*WalletManager) Lock ¶
func (wm *WalletManager) Lock(name string)
func (*WalletManager) LockAllwallets ¶
func (wm *WalletManager) LockAllwallets()
func (*WalletManager) Open ¶
func (wm *WalletManager) Open(name string)
func (*WalletManager) RemoveKey ¶
func (wm *WalletManager) RemoveKey(name, password, key string)
func (*WalletManager) SetDir ¶
func (wm *WalletManager) SetDir(path string)
func (*WalletManager) SetTimeOut ¶
func (wm *WalletManager) SetTimeOut(t int64)
func (*WalletManager) SignDigest ¶
func (wm *WalletManager) SignDigest(digest common.DigestType, key ecc.PublicKey) (sig ecc.Signature)
func (*WalletManager) SignTransaction ¶
func (wm *WalletManager) SignTransaction(txn *types.SignedTransaction, keys []ecc.PublicKey, chainID common.ChainIdType) *types.SignedTransaction
func (*WalletManager) Unlock ¶
func (wm *WalletManager) Unlock(name, password string)
type WalletPlugin ¶
type WalletPlugin struct { AbstractPlugin // contains filtered or unexported fields }
func NewWalletPlugin ¶
func NewWalletPlugin(io *asio.IoContext) *WalletPlugin
func (*WalletPlugin) GetWalletManager ¶
func (w *WalletPlugin) GetWalletManager() *WalletManager
func (*WalletPlugin) PluginInitialize ¶
func (w *WalletPlugin) PluginInitialize(c *cli.Context)
func (*WalletPlugin) PluginShutdown ¶
func (w *WalletPlugin) PluginShutdown()
func (*WalletPlugin) PluginStartup ¶
func (w *WalletPlugin) PluginStartup()
func (*WalletPlugin) SetProgramOptions ¶
func (w *WalletPlugin) SetProgramOptions(options *[]cli.Flag)
type YhCapabilities ¶
type YhCapabilities struct { }
type YhConnector ¶
type YhConnector struct { }
type YubihsmApi ¶
type YubihsmApi struct { }
type YubihsmWallet ¶
type YubihsmWallet struct {
// contains filtered or unexported fields
}
func (YubihsmWallet) GetPrivateKey ¶
func (y YubihsmWallet) GetPrivateKey(pubkey ecc.PublicKey) ecc.PrivateKey
func (YubihsmWallet) IsLocked ¶
func (y YubihsmWallet) IsLocked() bool
func (YubihsmWallet) Lock ¶
func (y YubihsmWallet) Lock()
type YubihsmWalletImpl ¶
type YubihsmWalletImpl struct { Connector *YhConnector Session *YhSession Endpoint string AuthKey uint16 Keys KeyMapType AuthKeyCaps YhCapabilities AuthKeyDomains uint16 Api YubihsmApi }
func (YubihsmWalletImpl) IsLocked ¶
func (y YubihsmWalletImpl) IsLocked() bool
func (YubihsmWalletImpl) Lock ¶
func (y YubihsmWalletImpl) Lock()
func (YubihsmWalletImpl) Unlock ¶
func (y YubihsmWalletImpl) Unlock(password string)
Click to show internal directories.
Click to hide internal directories.