Class KeyringFactoryWrapper


  • public class KeyringFactoryWrapper
    extends java.lang.Object
    Representing a KeyringFactoryWrapper class which wraps all of static methods of KeyringFactory
    • Constructor Summary

      Constructors 
      Constructor Description
      KeyringFactoryWrapper()
      Creates a KeyringFactoryWrapper instance
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      SingleKeyring create​(java.lang.String address, java.lang.String key)
      Creates a single type of keyring instance.
      MultipleKeyring create​(java.lang.String address, java.lang.String[] keys)
      Creates a multiple type of keyring instance.
      RoleBasedKeyring create​(java.lang.String address, java.util.List<java.lang.String[]> keys)
      Creates a roleBased type of keyring instance.
      SingleKeyring createFromKlaytnWalletKey​(java.lang.String klaytnWalletKey)
      Creates a single type of keyring instance from KlaytnWalletKey string.
      SingleKeyring createFromPrivateKey​(java.lang.String key)
      Creates a single type of keyring instance with private key.
      MultipleKeyring createWithMultipleKey​(java.lang.String address, java.lang.String[] multipleKey)
      Creates a multiple type of keyring instance from address and private key strings.
      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.
      SingleKeyring createWithSingleKey​(java.lang.String address, java.lang.String key)
      Creates a single type of keyring instance from address and private key string.
      AbstractKeyring decrypt​(KeyStore keystore, java.lang.String password)
      Decrypts a keystore v3 or v4 and returns a keyring instance.
      AbstractKeyring decrypt​(java.lang.String keyStore, java.lang.String password)
      Decrypts a KeyStore json string and returns a keyring instance.
      SingleKeyring generate()
      Generates a single type of keyring instance.
      SingleKeyring generate​(java.lang.String entropy)
      Generates a single type of keyring instance with entropy.
      java.lang.String[] generateMultipleKeys​(int num)
      Generates an array of private key strings.
      java.lang.String[] generateMultipleKeys​(int num, java.lang.String entropy)
      Generates an array of private key strings with entropy.
      java.util.List<java.lang.String[]> generateRoleBasedKeys​(int[] numArr)
      Generates an list of private key strings.
      java.util.List<java.lang.String[]> generateRoleBasedKeys​(int[] numArr, java.lang.String entropy)
      Generates an list of private key strings.
      java.lang.String generateSingleKey()
      Generates a single private key string.
      java.lang.String generateSingleKey​(java.lang.String entropy)
      Generates a single private key string with entropy.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • KeyringFactoryWrapper

        public KeyringFactoryWrapper()
        Creates a KeyringFactoryWrapper instance
    • Method Detail

      • generate

        public SingleKeyring generate()
        Generates a single type of keyring instance.
        Returns:
        SingleKeyring
      • generate

        public SingleKeyring generate​(java.lang.String entropy)
        Generates a single type of keyring instance with entropy.
        Parameters:
        entropy - A random string to create keyring.
        Returns:
        SingleKeyring
      • generateSingleKey

        public java.lang.String generateSingleKey()
        Generates a single private key string.
        Returns:
        String
      • generateSingleKey

        public java.lang.String generateSingleKey​(java.lang.String entropy)
        Generates a single private key string with entropy.
        Parameters:
        entropy - A random string to create private key.
        Returns:
        String
      • generateMultipleKeys

        public java.lang.String[] generateMultipleKeys​(int num)
        Generates an array of private key strings.
        Parameters:
        num - A length of keys.
        Returns:
        String array
      • generateMultipleKeys

        public java.lang.String[] generateMultipleKeys​(int num,
                                                       java.lang.String entropy)
        Generates an array of private key strings with entropy.
        Parameters:
        num - A length of keys.
        entropy - A random string to create private key.
        Returns:
        String array
      • generateRoleBasedKeys

        public java.util.List<java.lang.String[]> generateRoleBasedKeys​(int[] numArr)
        Generates an list of private key strings.
        Parameters:
        numArr - An array containing the number of keys for each role.
        Returns:
        List
      • generateRoleBasedKeys

        public java.util.List<java.lang.String[]> generateRoleBasedKeys​(int[] numArr,
                                                                        java.lang.String entropy)
        Generates an list of private key strings.
        Parameters:
        numArr - An array containing the number of keys for each role.
        entropy - A random string to create private key.
        Returns:
        List
      • create

        public SingleKeyring create​(java.lang.String address,
                                    java.lang.String key)
        Creates a single type of keyring instance.
        Parameters:
        address - The address of keyring.
        key - The key of keyring.
        Returns:
        SingleKeyring
      • create

        public MultipleKeyring create​(java.lang.String address,
                                      java.lang.String[] keys)
        Creates a multiple type of keyring instance.
        Parameters:
        address - The address of keyring.
        keys - The key list of keyring.
        Returns:
        MultipleKeyring
      • create

        public RoleBasedKeyring create​(java.lang.String address,
                                       java.util.List<java.lang.String[]> keys)
        Creates a roleBased type of keyring instance.
        Parameters:
        address - The address of keyring.
        keys - The key list of keyring.
        Returns:
        RoleBasedKeyring
      • createFromPrivateKey

        public SingleKeyring createFromPrivateKey​(java.lang.String key)
        Creates a single type of keyring instance with private key.
        Parameters:
        key - A private key string.
        Returns:
        SingleKeyring
      • createFromKlaytnWalletKey

        public SingleKeyring createFromKlaytnWalletKey​(java.lang.String klaytnWalletKey)
        Creates a single type of keyring instance from KlaytnWalletKey string.
        Parameters:
        klaytnWalletKey - A key string in KlaytnWalletKey format.
        Returns:
        SingleKeyring
      • createWithSingleKey

        public SingleKeyring createWithSingleKey​(java.lang.String address,
                                                 java.lang.String key)
        Creates a single type of keyring instance from address and private key string.
        Parameters:
        address - An address of keyring.
        key - A private key string.
        Returns:
        SingleKeyring
      • createWithMultipleKey

        public MultipleKeyring createWithMultipleKey​(java.lang.String address,
                                                     java.lang.String[] multipleKey)
        Creates a multiple type of keyring instance from address and private key strings.
        Parameters:
        address - An address of keyring.
        multipleKey - An array of private key strings.
        Returns:
        MultipleKeyring
      • createWithRoleBasedKey

        public 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.
        Parameters:
        address - An address of keyring.
        roleBasedKey - A List of private key strings.
        Returns:
        RoleBasedKeyring
      • decrypt

        public AbstractKeyring decrypt​(java.lang.String keyStore,
                                       java.lang.String password)
                                throws org.web3j.crypto.CipherException,
                                       java.io.IOException
        Decrypts a KeyStore json string and returns a keyring instance.
        Parameters:
        keyStore - The encrypted keystore to decrypt.
        password - The password to use for decryption.
        Returns:
        AbstractKeyring
        Throws:
        org.web3j.crypto.CipherException
        java.io.IOException
      • decrypt

        public AbstractKeyring decrypt​(KeyStore keystore,
                                       java.lang.String password)
                                throws org.web3j.crypto.CipherException
        Decrypts a keystore v3 or v4 and returns a keyring instance.
        Parameters:
        keystore - The encrypted keystore to decrypt.
        password - The password to use for decryption.
        Returns:
        AbstractKeyring
        Throws:
        org.web3j.crypto.CipherException - It throws when cipher operation has failed.