# Snowflake - Retrieve a private key

**Context**\
\
This page is linked to the [Snowflake connector creation process](/integrations/other-integrations/data-warehouse/snowflake---daily-exports-from-ab-tasty-to-snowflake.md).\
It will allow you to use the Public Key authentication method.

{% stepper %}
{% step %}

### Create a private key

If you haven’t created a key pair yet, you can generate one with the `openssl` command-line tool. Use the following command to produce an unencrypted private key file:

```
openssl genpkey -algorithm RSA -out rsa_key.pem -pkeyopt rsa_keygen_bits:2048
```

A new file rsa\_key.pem should be created in your current folder
{% endstep %}

{% step %}

### Generate a matching public key

Once you have your private key, you need to generate a matching public key. You can do so with the following command:

```
openssl rsa -in rsa_key.pem -pubout -out rsa_key.pub
```

A new file rsa\_key.pub should be created in your current folder.
{% endstep %}

{% step %}

### Add the public key to a Snowflake User

While on Snowflake editior, You can use this SQL command.\
Replace `<user_name>` with your user name and `<public_key_value>` with your public key.

```
use role securityadmin;

alter user YOUR_USER_NAME
set rsa_public_key='YOUR PUBLIC KEY'; // Paste here your public key
```

If you want to check to be sure this user is linked to your public key, you can check with this command&#x20;

```
show users like 'YOUR_USER_NAME';
```

The [column has\_rsa\_public\_key ](#user-content-fn-1)[^1]should be set to `true`
{% endstep %}

{% step %}

### Success !&#x20;

You can now resume your [connector creation](/integrations/other-integrations/data-warehouse/snowflake---daily-exports-from-ab-tasty-to-snowflake.md#h_01htfvdqygkza5teaj0x85b63g)
{% endstep %}
{% endstepper %}

[^1]: ![](/files/9gbNqvjUGLmp7p7cK2Il)


---

# 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.abtasty.com/integrations/other-integrations/data-warehouse/snowflake---daily-exports-from-ab-tasty-to-snowflake/snowflake-retrieve-a-private-key.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.
