JDBC connection for Snowflake using Key Pair Authentication

Sanjay Sharma
Tera Expert

Hi all,

We are trying to establish JDBC connection to Snowflake using Key Pair Authentication. I have uploaded the Snowflake drivers JAR to Mid Server and configured a data source to build connection string to pass private key and password as per https://docs.snowflake.com/en/user-guide/jdbc-configure.html#using-key-pair-authentication.

However, I am getting following error while loading data into ServiceNow

MID Server reported error: java.sql.SQLException: net.snowflake.client.jdbc.SnowflakeSQLException: Private key provided is invalid or not supported: D:/snowflake/privatekey/rsa_keyP.p8: Cannot retrieve the PKCS8EncodedKeySpec

How can this issue be resolved as our internal security policies to connect Snowflake allow to use only via private that is encrypted?

Thanks!