Skip to content
This repository was archived by the owner on May 23, 2022. It is now read-only.

add documentation for new --force flag in dfx identity new/import #736

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions modules/developers-guide/pages/cli-reference/dfx-identity.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Use the `+dfx identity import+` command to create a user identity by importing t

[source,bash,subs=quotes]
----
dfx identity import [flag] _identity-name_ _pem_file-name_
dfx identity import [options] _identity-name_ _pem_file-name_
----

=== Flags
Expand All @@ -163,6 +163,17 @@ You can use the following optional flags with the `+dfx identity import+` comman
|`+-V+`, `+--version+` |Displays version information.
|===

=== Options

You can specify the following options for the `+dfx identity import+` command.

[width="100%",cols="<32%,<68%",options="header"]
|===
|Argument|Description
|`+--disable-encryption+` |DANGEROUS: By default, PEM files are encrypted with a password when writing them to disk. I you want the convenience of not having to type your password (but at the risk of having your PEM file compromised), you can disable the encryption with this flag.
|`+--force+` |If the identity already exists, remove and re-import it.
|===

=== Examples

You can use the `+dfx identity import+` command to import a PEM file that contains the security certificate to use for an identity.
Expand Down Expand Up @@ -234,7 +245,7 @@ Therefore, you can use any identity you add using the `+dfx identity new+` comma

[source,bash]
----
dfx identity new [flag] _identity-name_
dfx identity new [options] _identity-name_
----

=== Flags
Expand All @@ -261,6 +272,19 @@ This argument is required.

|===

=== Options

You can specify the following options for the `+dfx identity new+` command.

[width="100%",cols="<32%,<68%",options="header"]
|===
|Argument|Description
|`+--disable-encryption+` |DANGEROUS: By default, PEM files are encrypted with a password when writing them to disk. I you want the convenience of not having to type your password (but at the risk of having your PEM file compromised), you can disable the encryption with this flag.
|`+--force+` |If the identity already exists, remove and re-import it.
|`+--hsm-key-id <hsm key id>+` |A sequence of pairs of hex digits.
|`+--hsm-pkcs11-lib-path <hsm pkcs11 lib path>+` |The file path to the opensc-pkcs11 library e.g. "/usr/local/lib/opensc-pkcs11.so"
|===

=== Examples

You can then use `+dfx identity new+` to create new user identities and store credentials for those identities in `+$HOME/.config/dfx/identity/<identity_name>/identity.pem+` files.
Expand Down