ODBC Driver for Snowflake

Obtaining Credentials for Key Pair Authentication - ODBC Driver for Snowflake

Obtaining Credentials for Key Pair Authentication

To use key pair authentication to connect to Snowflake, generate an RSA key pair using OpenSSL and assign the public key to your Snowflake user.

  1. Open a terminal.
  2. Generate a private key. Replace <your_private_key> with a file name for the private key.
    • For an unencrypted private key:
    • openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out <your_private_key> -nocrypt
      
    • For an encrypted private key:
    • openssl genrsa 2048 | openssl pkcs8 -topk8 -v2 des3 -inform PEM -out <your_private_key>
      

      When prompted, enter an encryption password.

  3. Generate the public key from the private key. Replace <your_private_key> with your private key file name and <your_public_key> with a file name for the public key.
    openssl rsa -in <your_private_key> -pubout -out <your_public_key>
    

    If the private key is encrypted, enter the encryption password you used to encrypt it when prompted.

  4. Open the public key file and copy the key value. Exclude the -----BEGIN PUBLIC KEY----- and -----END PUBLIC KEY----- lines and remove all line breaks.
  5. In Snowflake, open a worksheet.
  6. Run the following command to assign the public key to your Snowflake user. Replace <your_snowflake_user> with the name of your Snowflake user and <your_public_key_value> with the public key value you copied in the previous step.
    ALTER USER <your_snowflake_user> SET RSA_PUBLIC_KEY='<your_public_key_value>';
    
  7. In the driver configuration dialog, specify the path to the private key file in PrivateKey. If the private key is encrypted, enter its encryption password in Passphrase.

See Also

Connection String Parameters

Windows DSN Configuration

Obtaining Credentials for OAuth 2.0 Authentication

© 2015-2026 Devart. All Rights Reserved. Request Support ODBC Forum Provide Feedback