Valid SPS-C01 Dumps shared by EduDump.com for Helping Passing SPS-C01 Exam! EduDump.com now offer the newest SPS-C01 exam dumps, the EduDump.com SPS-C01 exam questions have been updated and answers have been corrected get the newest EduDump.com SPS-C01 dumps with Test Engine here:
You are developing a Snowpark Python application that connects to Snowflake using key pair authentication. You have the private key stored securely in an environment variable named 'SNOWFLAKE PRIVATE KEY. Which of the following code snippets correctly establishes a Snowpark session using this method, assuming all other necessary connection parameters (account, user, database, schema, warehouse) are also set as environment variables?
Correct Answer: D
Option D is correct because it properly retrieves the private key from the environment variable, decodes the PEM format, and passes it to the connection parameters after converting the key object to a string. It uses the cryptography library to handle the private key securely, which is required for key pair authentication. The code snippet decodes the private key using cryptography library and creates a string, which then is passed to the connection parameters to create a session. Option A fails to use the cryptography library and just passes the private key directly. Option B is incorrect because it doesn't use the 'configs' method, which is the correct way to pass all connection parameters at once. Option C doesn't encode the private key properly, and does not convert to string after decoding using cryptography. Option E does convert to string, but is not secure as the private key is directly passed without decoding it using the cryptography library.