case class CreateStorageCmd(toolConf: ErgoToolConfig, name: String, mnemonic: Mnemonic, storagePass: Array[Char], storageDir: String, storageFileName: String) extends Cmd with Product with Serializable

Create a new json file with encrypted content storing a secret key.

The format of secret file corresponds to org.ergoplatform.wallet.secrets.EncryptedSecret. By default it uses the following cipher parameters {"prf":"HmacSHA256","c":128000,"dkLen":256} which information is openly stored in the storage file in order to be able to decipher it (see org.ergoplatform.wallet.settings.EncryptionSettings).

Command steps:
1) request the user to enter a mnemonic phrase (or read it from input stream)
2) request the user to enter a mnemonic password twice
3) request the user to enter a storage encryption password twice (storagePass
4) use the (mnemonic, mnemonicPass) pair instance to generate secret seed (see Mnemonic.toSeed)
5) use storagePass to encrypt seed with AES using "AES/GCM/NoPadding" javax.crypto.Cipher
6) save encrypted seed (along with additional data necessary for decryption) in the given file (storageFileName) of the given directory (storageDir).
7) print the path to the created file to the console output

mnemonic

instance of Mnemonic holding both mnemonic phrase and mnemonic password.

storagePass

password used to encrypt the file and which is necessary to access and decipher the file.

storageDir

directory (relative to the current) where to put storage file (default is "storage")

storageFileName

name of the storage file (default is "secret.json")

Linear Supertypes
Serializable, Serializable, Product, Equals, Cmd, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CreateStorageCmd
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Cmd
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new CreateStorageCmd(toolConf: ErgoToolConfig, name: String, mnemonic: Mnemonic, storagePass: Array[Char], storageDir: String, storageFileName: String)

    mnemonic

    instance of Mnemonic holding both mnemonic phrase and mnemonic password.

    storagePass

    password used to encrypt the file and which is necessary to access and decipher the file.

    storageDir

    directory (relative to the current) where to put storage file (default is "storage")

    storageFileName

    name of the storage file (default is "secret.json")

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def apiKey: String

    ApiKey which is used for Ergo node API authentication.

    ApiKey which is used for Ergo node API authentication. This is a secret key whose hash was used in Ergo node config. This is only necessary to communicate to the protected parts of node API.

    Definition Classes
    Cmd
  5. def apiUrl: String

    Returns the url of the Ergo blockchain node used to communicate with the network.

    Returns the url of the Ergo blockchain node used to communicate with the network.

    Definition Classes
    Cmd
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def error(msg: String): Nothing

    Helper method to throw a new CmdException from this command.

    Helper method to throw a new CmdException from this command.

    Definition Classes
    Cmd
  10. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. val mnemonic: Mnemonic
  14. val name: String

    Returns the name of this command (Example: send, mnemonic etc.)

    Returns the name of this command (Example: send, mnemonic etc.)

    Definition Classes
    CreateStorageCmdCmd
  15. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. def networkType: NetworkType

    Returns the network type (MAINNET or TESTNET) ErgoTool is expected to communicate.

    Returns the network type (MAINNET or TESTNET) ErgoTool is expected to communicate. This parameter should correspond to the real network type of the node pointed to by apiUrl.

    Definition Classes
    Cmd
  17. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. def run(ctx: AppContext): Unit

    Runs this command using given AppContext.

    Runs this command using given AppContext.

    ctx

    context information of this command execution collected from command line, configuration file etc.

    Definition Classes
    CreateStorageCmdCmd
    Exceptions thrown

    CmdException when command execution fails

  20. val storageDir: String
  21. val storageFileName: String
  22. val storagePass: Array[Char]
  23. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  24. val toolConf: ErgoToolConfig

    Returns current tool configuration parameters

    Returns current tool configuration parameters

    Definition Classes
    CreateStorageCmdCmd
  25. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Cmd

Inherited from AnyRef

Inherited from Any

Ungrouped