> For the complete documentation index, see [llms.txt](https://yubico.gitbook.io/yubikey5/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yubico.gitbook.io/yubikey5/piv-1/commands/keys/import.md).

# import

Import a private key from file. Write a private key to one of the PIV slots on the YubiKey.

## <mark style="color:red;">ykman piv</mark> keys import <mark style="color:red;">OPTIONS</mark> SLOT PRIVATE-KEY

<table><thead><tr><th width="284">Options</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:red;">-h, --help</mark></td><td>Show this message and exit.</td></tr><tr><td><mark style="color:red;">-m, --management-key TEXT</mark></td><td>The management key.</td></tr><tr><td><mark style="color:red;">--pin-policy [DEFAULT|NEVER ONCE|ALWAYS]</mark></td><td>PIN policy for slot.</td></tr><tr><td><mark style="color:red;">-p, --password TEXT</mark></td><td>Password used to decrypt the private key.</td></tr><tr><td><mark style="color:red;">-P, --pin TEXT</mark></td><td>PIN code.</td></tr><tr><td><mark style="color:red;">--touch-policy [DEFAULT| NEVER|ALWAYS|CACHED]</mark></td><td>Touch policy for slot.</td></tr></tbody></table>

<table><thead><tr><th width="291">Arguments</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:red;">PRIVATE-KEY</mark></td><td>File containing the private key. <br>Use <mark style="color:red;"><code>'-'</code></mark> to use <mark style="color:red;"><code>stdin</code></mark>.</td></tr><tr><td><mark style="color:red;">SLOT</mark></td><td>PIV slot of the private key.</td></tr></tbody></table>

### <mark style="color:blue;">HELP</mark>

{% tabs %}
{% tab title="Help Command" %}

```properties
Usage: ykman.exe piv keys import [OPTIONS] SLOT PRIVATE-KEY

  Import a private key from file.

  Write a private key to one of the PIV slots on the YubiKey.

  SLOT        PIV slot of the private key.
  PRIVATE-KEY File containing the private key. Use '-' to use stdin.

Options:
  -P, --pin TEXT                  PIN code.
  -m, --management-key TEXT       The management key.
  --pin-policy [DEFAULT|NEVER|ONCE|ALWAYS]
                                  PIN policy for slot.
  --touch-policy [DEFAULT|NEVER|ALWAYS|CACHED]
                                  Touch policy for slot.
  -p, --password TEXT             Password used to decrypt the private key.
  -h, --help                      Show this message and exit.
```

{% endtab %}
{% endtabs %}

### <mark style="color:blue;">EXAMPLE</mark>

{% tabs %}
{% tab title="example 1" %}

```
```

{% endtab %}
{% endtabs %}
