public class PrivateKeyManager extends Object
| 构造器和说明 |
|---|
PrivateKeyManager()
generate key pair (default: ed25519)
|
PrivateKeyManager(boolean isDefault,
String chainCode) |
PrivateKeyManager(byte[] seed) |
PrivateKeyManager(byte[] seed,
KeyType type)
generate key pair
|
PrivateKeyManager(KeyType type)
generate key pair
|
PrivateKeyManager(KeyType type,
String chainCode)
generate key pair
|
PrivateKeyManager(String skey)
generate key pair
|
PrivateKeyManager(String skey,
String chainCode) |
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
encPrivateKeyToHex(String pKey) |
String |
getEncAddress() |
static String |
getEncAddress(String pKey) |
static String |
getEncAddress(String pKey,
String chainCode) |
String |
getEncPrivateKey() |
static String |
getEncPrivateKey(byte[] raw_skey,
KeyType type)
原生转星火私钥
|
String |
getEncPublicKey() |
static String |
getEncPublicKey(byte[] rawPKey,
KeyType type)
原生转星火公钥
|
static String |
getEncPublicKey(String skey) |
KeyType |
getKeyType()
get key type
|
PublicKeyManager |
getPublicKey()
get public key
|
byte[] |
getRawPrivateKey()
get raw private key
|
byte[] |
getRawPublicKey()
获取原生公钥
|
static boolean |
isAddressValid(String encAddress) |
static boolean |
isPrivateKeyValid(String encPrivateKey) |
static boolean |
isPublicKeyValid(String encPublicKey) |
void |
setKeyType(KeyType keyType)
set key type
|
void |
setRawPrivateKey(byte[] rawSKey)
set raw private key
|
byte[] |
sign(byte[] msg)
sign message
|
static byte[] |
sign(byte[] msg,
String skey)
sign message
|
public PrivateKeyManager()
throws EncException
EncExceptionpublic PrivateKeyManager(boolean isDefault,
String chainCode)
throws EncException
EncExceptionpublic PrivateKeyManager(KeyType type) throws EncException
type - the type of keyEncExceptionpublic PrivateKeyManager(KeyType type, String chainCode) throws EncException
type - the type of keyEncExceptionpublic PrivateKeyManager(byte[] seed,
KeyType type)
seed - the seedpublic PrivateKeyManager(byte[] seed)
public PrivateKeyManager(String skey) throws EncException
skey - private keyEncExceptionpublic PrivateKeyManager(String skey, String chainCode) throws EncException
EncExceptionpublic void setKeyType(KeyType keyType)
keyType - key typepublic KeyType getKeyType()
public void setRawPrivateKey(byte[] rawSKey)
rawSKey - private keypublic byte[] getRawPrivateKey()
public byte[] getRawPublicKey()
public PublicKeyManager getPublicKey()
public String getEncPrivateKey() throws EncException
EncExceptionpublic static boolean isPrivateKeyValid(String encPrivateKey)
encPrivateKey - encode private keypublic String getEncPublicKey() throws EncException
EncExceptionpublic static String getEncPublicKey(String skey) throws EncException
skey - encode private keyEncExceptionpublic static String getEncPublicKey(byte[] rawPKey, KeyType type)
rawPKey - type - public static boolean isPublicKeyValid(String encPublicKey)
encPublicKey - encode public keypublic String getEncAddress() throws EncException
EncException - getEncAddresspublic 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 byte[] sign(byte[] msg)
throws EncException
msg - messageEncExceptionpublic static byte[] sign(byte[] msg,
String skey)
throws EncException
msg - messageskey - private keyEncExceptionpublic static String getEncPrivateKey(byte[] raw_skey, KeyType type) throws EncException
type - raw_skey - EncExceptionpublic static byte[] encPrivateKeyToHex(String pKey) throws EncException
EncExceptionCopyright © 2025. All rights reserved.