9 Star 42 Fork 10

Luyu Community / Luyu Cross Chain Protocol

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Account.java 1.70 KB
一键复制 编辑 原始数据 按行查看 历史
JimmyShi22 提交于 2021-09-28 21:09 . support set property in account
package link.luyu.protocol.network;
public interface Account {
interface SignCallback {
/**
* @param status common.STATUS
* @param message Error message
* @param signBytes Signature bytes
*/
void onResponse(int status, String message, byte[] signBytes);
}
interface VerifyCallback {
/**
* @param status common.STATUS
* @param message Error message
* @param verifyResult verify result
*/
void onResponse(int status, String message, boolean verifyResult);
}
/**
* Get public key of this account
*
* @return
*/
byte[] getPubKey();
/**
* Sign message with this account secret key
*
* @param message The message for signing
* @param callback
*/
void sign(byte[] message, SignCallback callback);
/**
* Verify signature of this account
*
* @param signBytes Signature with binary encoded
* @param message The message for signing
* @param callback
*/
void verify(byte[] signBytes, byte[] message, VerifyCallback callback);
/**
* Set property for this algorithm account. Plugin can save some extra data of this account if
* needed. Notices that the properties are belongs to the keyPair, if default keyPair change,
* properties would be changed.
*
* @param key The key of the value
* @param value The value of the key
*/
void setProperty(String key, String value);
/**
* Get property for this algorithm account of a certain key
*
* @param key The key of the value
* @return Return null if value is not existing
*/
String getProperty(String key);
}
Java
1
https://gitee.com/luyu-community/luyu-cross-chain-protocol.git
git@gitee.com:luyu-community/luyu-cross-chain-protocol.git
luyu-community
luyu-cross-chain-protocol
Luyu Cross Chain Protocol
master

搜索帮助