case class ExtractStorageCmd(toolConf: ErgoToolConfig, name: String, storageFile: String, storagePass: Array[Char], prop: String, network: NetworkType) extends Cmd with Product with Serializable
Extracts secret data from encrypted storage file (e.g. created by CreateStorageCmd).
Steps:
1) request storage password (storagePass)
2) load encrypted data from storageFile into SecretStorage instance
3) unlock the instance using storagePass and retrieve secret data from storage
4) depending on the parameter prop
:
- "address" => get master key address for the given
network
(see BIP-32) - "masterKey" => serialize org.ergoplatform.wallet.secrets.ExtendedSecretKey into bytes
and encode as base16 - "secretKey" => get bytes of the secret key and encode as base16
- "publicKey" => get bytes of the public key and encode as base16
5) print obtained secret string to the console output
Note, a storage file doesn't contain network type information, this the same storage can be used to obtain address both from mainnet and from testnet.
- storageFile
path to encrypted storage file
- storagePass
encryption password necessary to access storage file content
- prop
name of the secret data stored in the file (e.g. PropAddress)
- network
network type
- Alphabetic
- By Inheritance
- ExtractStorageCmd
- Serializable
- Serializable
- Product
- Equals
- Cmd
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
ExtractStorageCmd(toolConf: ErgoToolConfig, name: String, storageFile: String, storagePass: Array[Char], prop: String, network: NetworkType)
- storageFile
path to encrypted storage file
- storagePass
encryption password necessary to access storage file content
- prop
name of the secret data stored in the file (e.g. PropAddress)
- network
network type
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
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
-
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
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
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
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
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
- ExtractStorageCmd → Cmd
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- val network: NetworkType
-
def
networkType: NetworkType
Returns the network type (MAINNET or TESTNET) ErgoTool is expected to communicate.
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val prop: String
-
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
- ExtractStorageCmd → Cmd
- Exceptions thrown
CmdException
when command execution fails
- val storageFile: String
- val storagePass: Array[Char]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
val
toolConf: ErgoToolConfig
Returns current tool configuration parameters
Returns current tool configuration parameters
- Definition Classes
- ExtractStorageCmd → Cmd
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )