View Source MyspaceIPFS.Key (Myspace IPFS v0.2.0-alpha.1)
MyspaceIPFS.Key is where the key commands of the IPFS API reside.
Link to this section Summary
Functions
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 gen(binary(), list()) :: {:ok, any()} | MyspaceIPFS.Api.error_response()
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(binary(), binary(), list()) :: {:ok, any()} | MyspaceIPFS.Api.error_response()
Import a key and prints imported key id.
parameters
Parameters
key
- Name of the key to import.
name
- 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(list()) :: {:ok, any()} | MyspaceIPFS.Api.error_response()
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(binary(), binary(), list()) :: {:ok, any()} | MyspaceIPFS.Api.error_response()
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(binary(), list()) :: {:ok, any()} | MyspaceIPFS.Api.error_response()
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(binary(), list()) :: {:ok, any()} | MyspaceIPFS.Api.error_response()
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.
]