Show / Hide Table of Contents

Class KeyCommand

Inheritance
Object
KeyCommand
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Libplanet.Extensions.Cocona.Commands
Assembly: Libplanet.Extensions.Cocona.dll
Syntax
public class KeyCommand

Constructors

| Improve this Doc View Source

KeyCommand()

Declaration
public KeyCommand()

Properties

| Improve this Doc View Source

KeyStore

Declaration
public IKeyStore KeyStore { get; set; }
Property Value
Type Description
IKeyStore

Methods

| Improve this Doc View Source

Create(PassphraseParameters, Boolean, Boolean, String)

Declaration
[Command(Description = "Create a new private key.")]
public void Create(PassphraseParameters passphrase, [Option(Description = "Print created private key as Web3 Secret Storage format.")] bool json = false, [Option(Description = "Do not add to the key store, but only show the created key.")] bool dryRun = false, [Option(Description = "Path to key store")] string path = null)
Parameters
Type Name Description
PassphraseParameters passphrase
Boolean json
Boolean dryRun
String path
| Improve this Doc View Source

Derive(String, Boolean)

Declaration
[Command(Description = "Derive public key and address from private key.")]
public void Derive([Argument("KEY", Description = "A raw private key (or a public key if -P/--public-key is used) to derive the address from.")] string key, [Option('P', Description = "Derive from a public key instead of a private key.")] bool publicKey = false)
Parameters
Type Name Description
String key
Boolean publicKey
| Improve this Doc View Source

Export(Guid, PassphraseParameters, Boolean, Boolean, Boolean, String)

Declaration
[Command(Description = "Export a raw private key (or public key).")]
public void Export([Argument("KEY-ID", Description = "A key UUID to export.")] Guid keyId, PassphraseParameters passphrase, [Option('P', Description = "Export a public key instead of private key.")] bool publicKey = false, [Option('b', Description = "Print raw bytes instead of hexadecimal.  No trailing LF appended.")] bool bytes = false, [Option(Description = "Export a Web3 Secret Storage Formatted json")] bool json = false, [Option(Description = "Path to key store to export from.")] string path = null)
Parameters
Type Name Description
Guid keyId
PassphraseParameters passphrase
Boolean publicKey
Boolean bytes
Boolean json
String path
| Improve this Doc View Source

Generate(Boolean, Boolean)

Declaration
[Command(Aliases = new string[]{"gen"}, Description = "Generate a raw private key without storing it.")]
public void Generate([Option('A', Description = "Do not show a derived address.")] bool noAddress = false, [Option('p', Description = "Show a public key as well.")] bool publicKey = false)
Parameters
Type Name Description
Boolean noAddress
Boolean publicKey
| Improve this Doc View Source

Import(String, PassphraseParameters, Boolean, Boolean, String)

Declaration
[Command(Description = "Import a raw private key or Web3 Secret Storage.")]
public void Import([Argument("PRIVATE-KEY", Description = "A raw private key in hexadecimal string, or path to Web3 Secret Storage to import")] string key, PassphraseParameters passphrase, [Option(Description = "Import Web3 Secret Storage key.")] bool json = false, [Option(Description = "Do not add to the key store, but only show the created key.")] bool dryRun = false, [Option(Description = "Path to key store.")] string path = null)
Parameters
Type Name Description
String key
PassphraseParameters passphrase
Boolean json
Boolean dryRun
String path
| Improve this Doc View Source

List(String)

Declaration
[PrimaryCommand]
[Command(Description = "List all private keys.")]
public void List([Option(Description = "Specify key store path to list.")] string path = null)
Parameters
Type Name Description
String path
| Improve this Doc View Source

Remove(Guid, PassphraseParameters, Boolean, String)

Declaration
[Command(Aliases = new string[]{"rm"}, Description = "Remove a private key.")]
public void Remove([Argument(Name = "KEY-ID", Description = "A key UUID to remove.")] Guid keyId, PassphraseParameters passphrase, [Option(Description = "Remove without asking passphrase.")] bool noPassphrase = false, [Option(Description = "Path to key store.")] string path = null)
Parameters
Type Name Description
Guid keyId
PassphraseParameters passphrase
Boolean noPassphrase
String path
| Improve this Doc View Source

Sign(Guid, String, PassphraseParameters, String, String)

Declaration
[Command(Description = "Sign a message.")]
public void Sign([Argument("KEY-ID", Description = "A key UUID to sign.")] Guid keyId, [Argument("FILE", Description = "A path of the file to sign. If you pass '-' dash character, it will receive the message to sign from stdin.")] string path, PassphraseParameters passphrase, [Option(Description = "A path of the file to save the signature. If you pass '-' dash character, it will print to stdout as raw bytes not hexadecimal string or else. If this option isn't given, it will print hexadecimal string to stdout as default behaviour.")] string binaryOutput = null, [Option(Description = "Path to key store to use key from.")] string storePath = null)
Parameters
Type Name Description
Guid keyId
String path
PassphraseParameters passphrase
String binaryOutput
String storePath
| Improve this Doc View Source

UnprotectKey(Guid, PassphraseParameters, Boolean)

Declaration
public PrivateKey UnprotectKey(Guid keyId, PassphraseParameters passphrase, bool ignoreStdin = false)
Parameters
Type Name Description
Guid keyId
PassphraseParameters passphrase
Boolean ignoreStdin
Returns
Type Description
PrivateKey
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2018–2023 Planetarium