public class KeyringFactory
extends java.lang.Object
Constructor and Description |
---|
KeyringFactory() |
Modifier and Type | Method and Description |
---|---|
static RoleBasedKeyring |
create(java.lang.String address,
java.util.List<java.lang.String[]> keys)
Creates a roleBased type of keyring instance.
|
static SingleKeyring |
create(java.lang.String address,
java.lang.String key)
Creates a single type of keyring instance.
|
static MultipleKeyring |
create(java.lang.String address,
java.lang.String[] keys)
Creates a multiple type of keyring instance.
|
static SingleKeyring |
createFromKlaytnWalletKey(java.lang.String klaytnWalletKey)
Creates a keyring instance from KlaytnWalletKey string.
|
static SingleKeyring |
createFromPrivateKey(java.lang.String key)
Creates a keyring instance with private key.
|
static MultipleKeyring |
createWithMultipleKey(java.lang.String address,
java.lang.String[] multipleKey)
Creates a multiple type of keyring instance from address and private key strings.
|
static RoleBasedKeyring |
createWithRoleBasedKey(java.lang.String address,
java.util.List<java.lang.String[]> roleBasedKey)
Create a roleBased type of keyring instance from address and private key strings.
|
static SingleKeyring |
createWithSingleKey(java.lang.String address,
java.lang.String key)
Creates a single type of keyring instance from address and private key string.
|
static AbstractKeyring |
decrypt(KeyStore keystore,
java.lang.String password)
Decrypts a keystore v3 or v4 and returns a keyring instance.
|
static AbstractKeyring |
decrypt(java.lang.String keyStore,
java.lang.String password)
Decrypts a KeyStore json string and returns a keyring instance.
|
static SingleKeyring |
generate()
Generates a keyring instance.
|
static SingleKeyring |
generate(java.lang.String entropy)
Generates a keyring instance with entropy.
|
static java.lang.String[] |
generateMultipleKeys(int num)
Generates an array of private key strings.
|
static java.lang.String[] |
generateMultipleKeys(int num,
java.lang.String entropy)
Generates an array of private key strings with entropy.
|
static java.util.List<java.lang.String[]> |
generateRolBasedKeys(int[] numArr)
Generates an list of private key strings.
|
static java.util.List<java.lang.String[]> |
generateRoleBasedKeys(int[] numArr,
java.lang.String entropy)
Generates an list of private key strings.
|
static java.lang.String |
generateSingleKey()
Generates a single private key string.
|
static java.lang.String |
generateSingleKey(java.lang.String entropy)
Generates a single private key string with entropy.
|
public static SingleKeyring generate()
public static SingleKeyring generate(java.lang.String entropy)
entropy
- A random string to create keyring.public static java.lang.String generateSingleKey()
public static java.lang.String generateSingleKey(java.lang.String entropy)
entropy
- A random string to create private key.public static java.lang.String[] generateMultipleKeys(int num)
num
- A length of keys.public static java.lang.String[] generateMultipleKeys(int num, java.lang.String entropy)
num
- A length of keys.entropy
- A random string to create private key.public static java.util.List<java.lang.String[]> generateRolBasedKeys(int[] numArr)
numArr
- An array containing the number of keys for each role.public static java.util.List<java.lang.String[]> generateRoleBasedKeys(int[] numArr, java.lang.String entropy)
numArr
- An array containing the number of keys for each role.entropy
- A random string to create private key.public static SingleKeyring create(java.lang.String address, java.lang.String key)
address
- The address of keyring.key
- The key of keyring.public static MultipleKeyring create(java.lang.String address, java.lang.String[] keys)
address
- The address of keyring.keys
- The key list of keyring.public static RoleBasedKeyring create(java.lang.String address, java.util.List<java.lang.String[]> keys)
address
- The address of keyring.keys
- The key list of keyring.public static SingleKeyring createFromPrivateKey(java.lang.String key)
key
- A private key string.public static SingleKeyring createFromKlaytnWalletKey(java.lang.String klaytnWalletKey)
klaytnWalletKey
- A key string in KlaytnWalletKey format.public static SingleKeyring createWithSingleKey(java.lang.String address, java.lang.String key)
address
- An address of keyring.key
- A private key string.public static MultipleKeyring createWithMultipleKey(java.lang.String address, java.lang.String[] multipleKey)
address
- An address of keyring.multipleKey
- An array of private key strings.public static RoleBasedKeyring createWithRoleBasedKey(java.lang.String address, java.util.List<java.lang.String[]> roleBasedKey)
address
- An address of keyring.roleBasedKey
- A List of private key strings.public static AbstractKeyring decrypt(java.lang.String keyStore, java.lang.String password) throws org.web3j.crypto.CipherException, java.io.IOException
keyStore
- The encrypted keystore to decrypt.password
- The password to use for decryption.org.web3j.crypto.CipherException
java.io.IOException
public static AbstractKeyring decrypt(KeyStore keystore, java.lang.String password) throws org.web3j.crypto.CipherException
keystore
- The encrypted keystore to decrypt.password
- The password to use for decryption.org.web3j.crypto.CipherException
- It throws when cipher operation has failed.