public class PublicKeyManager extends Object
| 构造器和说明 |
|---|
PublicKeyManager() |
PublicKeyManager(String encPublicKey)
structure with encrytion public key
|
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
encAddressToHex(String encAddress) |
static byte[] |
encPublicKeyToHex(String pKey) |
String |
getChainCode() |
String |
getEncAddress() |
static String |
getEncAddress(String pKey) |
static String |
getEncAddress(String pKey,
String chainCode) |
byte[] |
getRawPublicKey()
get raw public key
|
static String |
hexToEncAddress(byte[] rawAddress,
KeyType type) |
static boolean |
isAddressValid(String encAddress) |
static boolean |
isPublicKeyValid(String encPublicKey) |
void |
setChainCode(String chainCode) |
void |
setEncPublicKey(String encPublicKey)
set enc public key
|
void |
setKeyType(KeyType keyType)
set key type
|
void |
setRawPublicKey(byte[] rawPKey)
set raw public key
|
boolean |
verify(byte[] msg,
byte[] signMsg)
check sign datas
|
static boolean |
verify(byte[] msg,
byte[] signMsg,
String encPublicKey)
check sign datas
|
public PublicKeyManager()
public PublicKeyManager(String encPublicKey) throws EncException
EncExceptionpublic void setEncPublicKey(String encPublicKey) throws EncException
encPublicKey - encryption public keyEncExceptionpublic void setRawPublicKey(byte[] rawPKey)
rawPKey - raw public keypublic byte[] getRawPublicKey()
public void setKeyType(KeyType keyType)
keyType - key typepublic String getChainCode()
public void setChainCode(String chainCode)
public String getEncAddress() throws EncException
EncExceptionpublic static String getEncAddress(String pKey, String chainCode) throws EncException
pKey - encode public keyEncExceptionpublic static String getEncAddress(String pKey) throws EncException
pKey - encode public keyEncExceptionpublic static boolean isAddressValid(String encAddress)
encAddress - encode addresspublic static boolean isPublicKeyValid(String encPublicKey)
encPublicKey - encode public keypublic boolean verify(byte[] msg,
byte[] signMsg)
throws EncException
msg - source messagesignMsg - signed messageEncExceptionpublic static boolean verify(byte[] msg,
byte[] signMsg,
String encPublicKey)
throws EncException
msg - source messagesignMsg - signed messageencPublicKey - enc public keyEncExceptionpublic static byte[] encPublicKeyToHex(String pKey) throws EncException
EncExceptionpublic static byte[] encAddressToHex(String encAddress) throws EncException
EncExceptionpublic static String hexToEncAddress(byte[] rawAddress, KeyType type) throws EncException
EncExceptionCopyright © 2025. All rights reserved.