View Source MyspaceIPFS.Key (Myspace IPFS v0.1.0)
MyspaceIPFS.Key is where the key commands of the IPFS API reside.
Link to this section Summary
Functions
Export a keypair.
Create a new keypair.
Import a key and prints imported key id.
List all local keypairs.
Rename a keypair.
Remove a keypair.
Rotate a keypair.
Link to this section Functions
@spec export(name(), fspath(), opts()) :: okresult()
Export a keypair.
parameters
Parameters
key
- Name of the key to export.
output
- Output file path.
options
Options
https://docs.ipfs.io/reference/http/api/#api-v0-key-export
[
output: <string>, # Output file path.
format: <string>, # Key format.
]
@spec gen(name(), opts()) :: okresult()
Create a new keypair.
parameters
Parameters
key
- Name of the key to generate.
options
Options
https://docs.ipfs.io/reference/http/api/#api-v0-key-gen
[
type: <string>, # Key type.
size: <int>, # Key size.
ipns-base: <string>, # IPNS key base.
]
@spec import(name(), fspath(), opts()) :: okresult()
Import a key and prints imported key id.
parameters
Parameters
key
- Name of the key to import.
options
Options
https://docs.ipfs.io/reference/http/api/#api-v0-key-import
[
ipns-base: <string>, # IPNS key base.
format: <string>, # Key format.
allow-any-key-type: <bool>, # Allow any key type.
]
@spec list(opts()) :: okresult()
List all local keypairs.
options
Options
https://docs.ipfs.io/reference/http/api/#api-v0-key-list
[
l: <bool>, # Show extra information.
ipns-base: <string>, # IPNS key base.
]
@spec rename(name(), name(), opts()) :: okresult()
Rename a keypair.
parameters
Parameters
old
- Name of the key to rename.
new
- New name of the key.
options
Options
https://docs.ipfs.io/reference/http/api/#api-v0-key-rename
[
ipns-base: <string>, # IPNS key base.
force: <bool>, # Allow to overwrite existing key.
]
@spec rm(name(), opts()) :: okresult()
Remove a keypair.
parameters
Parameters
key
- Name of the key to remove.
options
Options
https://docs.ipfs.io/reference/http/api/#api-v0-key-rm
[
ipns-base: <string>, # IPNS key base.
l: <bool>, # Show extra information.
]
@spec rotate(name(), opts()) :: okresult()
Rotate a keypair.
parameters
Parameters
oldkey
- Keystore name for backing up the old key.
options
Options
https://docs.ipfs.io/reference/http/api/#api-v0-key-rotate
[
type: <string>, # Key type.
size: <int>, # Key size.
]