> 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/certificates/request.md).

# request

Generate a Certificate Signing Request (CSR). A private key must already be present in the corresponding key slot.

## <mark style="color:red;">ykman piv</mark> certificates request <mark style="color:red;">OPTIONS</mark> *SLOT PUBLIC-KEY CSR*

<table><thead><tr><th width="309">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;">-a, --hash-algorithm [SHA1|SHA256|SHA384|SHA512]</mark></td><td>Hash algorithm.<br>[default: <mark style="color:red;"><code>SHA256</code></mark>]</td></tr><tr><td><mark style="color:red;">-P, --pin TEXT</mark></td><td>PIN code.</td></tr><tr><td><mark style="color:red;">-s, --subject TEXT</mark></td><td>Subject for requested certificate, an RFC 4514 string. <br>[Required]</td></tr></tbody></table>

<table><thead><tr><th width="311">Arguments</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:red;">CSR</mark></td><td>File to write CSR to. <br>Use <mark style="color:red;"><code>'-'</code></mark> to use <mark style="color:red;"><code>stdout</code></mark>.</td></tr><tr><td><mark style="color:red;">PUBLIC-KEY</mark></td><td>File containing a public 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 certificate.</td></tr></tbody></table>

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

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

```properties
Usage: ykman.exe piv certificates request [OPTIONS] SLOT PUBLIC-KEY CSR

  Generate a Certificate Signing Request (CSR).

  A private key must already be present in the corresponding key slot.

  SLOT        PIV slot of the certificate.
  PUBLIC-KEY  File containing a public key. Use '-' to use stdin.
  CSR         File to write CSR to. Use '-' to use stdout.

Options:
  -P, --pin TEXT                  PIN code.
  -s, --subject TEXT              Subject for the requested certificate, as an RFC 4514 string.  [required]
  -a, --hash-algorithm [SHA1|SHA256|SHA384|SHA512]
                                  Hash algorithm.  [default: SHA256]
  -h, --help                      Show this message and exit.
```

{% endtab %}
{% endtabs %}

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

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

```
```

{% endtab %}
{% endtabs %}
