0

I set up a connection in DataGrip to my database table that has encrypted columns (randomized). I can query the data but the value of each encrypted column is an error message:

<failed to load>
com.microsoft.sqlserver.jdbc.SQLServerException: Failed to decrypt a column encryption key. Invalid key store provider name: AZURE_KEY_VAULT. A key store provider name must denote either a system key store provider or a registered custom key store provider. Valid system key provider names are: . Valid (currently registered) custom key store provider names are: null. Please verify key store provider information in column master key definitions in the database, and verify all custom key store providers used in your application are registered properly.
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.getSystemOrGlobalColumnEncryptionKeyStoreProvider(SQLServerConnection.java:1023)
    at com.microsoft.sqlserver.jdbc.SQLServerSymmetricKeyCache.getKey(SQLServerSymmetricKeyCache.java:90)
    at com.microsoft.sqlserver.jdbc.SQLServerSecurityUtility.decryptSymmetricKey(SQLServerSecurityUtility.java:232)
    at com.microsoft.sqlserver.jdbc.SQLServerSecurityUtility.decryptWithKey(SQLServerSecurityUtility.java:278)
    at com.microsoft.sqlserver.jdbc.ServerDTVImpl.getValue(dtv.java:3739)
    at com.microsoft.sqlserver.jdbc.DTV.getValue(dtv.java:247)
    at com.microsoft.sqlserver.jdbc.Column.getValue(Column.java:190)
    at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getValue(SQLServerResultSet.java:2081)
    at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getValue(SQLServerResultSet.java:2067)
    at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getString(SQLServerResultSet.java:2538)
    in JdbcHelperImpl.getObject(JdbcHelperImpl.java:306)

In the Advanced tab of the connection configuration, I set the following properties:

  • columnEncryptionSetting = Enabled
  • enclaveAttestationProtocol = AAS
  • enclaveAttestationUrl = https://{attestationService}.eus.attest.azure.net
  • encrypt = true

What other settings do I need to provide?

sartoris
  • 816
  • 1
  • 7
  • 21
  • Try https://stackoverflow.com/a/51624925/8203759 – Konstantin Annikov May 11 '22 at 03:37
  • @KonstantinAnnikov - that answer has nothing to do with DataGrip; are you just telling me I should use SSMS? – sartoris May 11 '22 at 23:07
  • @sartoris have you tried steps described in [Use Always Encrypted with the JDBC driver](https://learn.microsoft.com/en-us/sql/connect/jdbc/using-always-encrypted-with-the-jdbc-driver?view=sql-server-ver15) – Vasilii Chernov May 23 '22 at 14:58
  • Anyway, it looks like encryption is not fully supported ([DBE-5222](https://youtrack.jetbrains.com/issue/DBE-5222/Database-s-MSSQL-to-support-Always-Encrypted), [DBE-7337](https://youtrack.jetbrains.com/issue/DBE-7337/Support-to-edit-encrypted-cells-with-Always-Encrypted-feature-en)) – Vasilii Chernov May 23 '22 at 15:05

0 Answers0