Skip to main content

Key_Pair_Credentials.generate_key_pair

Key_Pair_Credentials.generate_key_pairlocationnameif_exists

Group: Database

Documentation

Generate a key pair that can be used for authentication. This function will generate a new key pair and store it in the provided Cloud location. The private key will be stored as an Enso_Secret that can be used when establishing a Database connection. The public key will be saved as a text file next to that secret. To finalize the setup, the public key must be associated with your account. To do so, you need to run a query like: ALTER USER <your_username> SET RSA_PUBLIC_KEY=<public_key_content>; See [https://docs.snowflake.com/en/user-guide/key-pair-auth#assign-the-public-key-to-a-snowflake-user](assign the public key to a snowflake user) for more information on the setup.

Arguments

  • location: A directory where the secret and the public key will be stored. Defaults to the user's home directory.
  • name: The name of the secret that will store the private key. The public key will be stored under the same name with the .pub extension.
  • if_exists: Specifies what to do if the key pair with the given name already exists. Defaults to warning the user and reusing the existing key pair.