1 Star 0 Fork 0

bigzoro/luyu_protocol

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
account.go 1.01 KB
一键复制 编辑 原始数据 按行查看 历史
张景涛 提交于 2024-05-23 17:12 . 第一次提交
package network
// SignCallback is a callback function for signing.
type SignCallback func(status int, message string, signBytes []byte)
// VerifyCallback is a callback function for signature verification.
type VerifyCallback func(status int, message string, verifyResult bool)
// Account interface represents an account.
type Account interface {
// GetPubKey returns the public key of this account.
GetPubKey() []byte
// Sign signs a message with this account's secret key.
Sign(message []byte, callback SignCallback)
// Verify verifies the signature of this account.
Verify(signBytes []byte, message []byte, callback VerifyCallback)
// SetProperty sets a property for this algorithm account. Plugin can save some extra data of this account if needed.
// Notices that the properties belong to the keyPair, if default keyPair changes, properties would be changed.
SetProperty(key string, value string)
// GetProperty retrieves a property for this algorithm account of a certain key.
GetProperty(key string) string
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/xiaoshengdada/luyu_protocol.git
git@gitee.com:xiaoshengdada/luyu_protocol.git
xiaoshengdada
luyu_protocol
luyu_protocol
ebe377f84765

搜索帮助