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.
<your_private_key> with a file name for the private key.
openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out <your_private_key> -nocrypt
openssl genrsa 2048 | openssl pkcs8 -topk8 -v2 des3 -inform PEM -out <your_private_key>
When prompted, enter an encryption password.
<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.
-----BEGIN PUBLIC KEY----- and -----END PUBLIC KEY----- lines and remove all line breaks.<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>';