# Generating DOA Keys

In order to use DOA, you need to pass the base64 encoded private key. Here is how you generate your private key:

## Generate the PEM Key

### Using Passport SDK

Install `passport-scope-cli`

{% tabs %}
{% tab title="npm" %}

<pre class="language-bash"><code class="lang-bash"><strong>npm install -g passport-scope-cli
</strong></code></pre>

{% endtab %}

{% tab title="yarn" %}

```bash
yarn global add passport-scope-cli
```

{% endtab %}

{% tab title="pnpm" %}

```bash
pnpm install -g passport-scope-cli
```

{% endtab %}
{% endtabs %}

Run the generate key command

```bash
passport-scope generate-keys --name passport
```

Post this, your private key file will be created in the same directory with name passport\_priv.der

### Using OpenSSL

```sh
openssl ecparam -name prime256v1 -genkey -noout -out private_key.pem
openssl pkcs8 -topk8 -inform PEM -outform DER -in private_key.pem -out passport_priv.der -nocrypt
```

## Base64 encode the Key

```shell
base64 -i passport_priv.der -o pasport_priv_base64.txt
```

And you are done, you may copy this value directly to your environment variable


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.0xpass.io/appendix/generating-doa-keys.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
