> ## Documentation Index
> Fetch the complete documentation index at: https://docs.primevault.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate Public-Private key pair for API User

Public and private keys are cryptographic tools used to secure communication and authenticate users in digital systems. In the context of API access, these keys help ensure only authorized users can interact securely with your service.

There are two recommended ways to generate your public-private key pair: using the SDK, or using OpenSSL from the command line.

## Option 1: Using the SDK

<Steps>
  <Step title="Set up the SDK">
    Make sure you have set up the SDK.
  </Step>

  <Step title="Generate the key pair">
    Call the `generatePublicPrivateKeyPair` util function in the SDK.
  </Step>

  <Step title="Save your keys">
    This will return your keys as strings. Save them securely.
  </Step>
</Steps>

## Option 2: Using OpenSSL (command line)

<Steps>
  <Step title="Install OpenSSL">
    Make sure OpenSSL is installed in your system.
  </Step>

  <Step title="Run the command">
    Run:

    ```bash theme={null}
    openssl ecparam -name prime256v1 -genkey -noout 2>/dev/null | tee >(openssl ec -pubout 2>/dev/null)
    ```
  </Step>

  <Step title="Save your keys">
    This will output your private key and then your public key. Copy and save them securely.
  </Step>
</Steps>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.