@@ -47,13 +47,13 @@ import com.microsoft.sqlserver.jdbc.SQLServerKeyVaultAuthenticationCallback;
4747
4848public class AKV_7_0_0 {
4949
50- private static String connectionUrl = " jdbc:sqlserver://localhost;integratedSecurity=true;database=test;columnEncryptionSetting=enabled" ;
51- static String applicationClientID = " ba2814e5-8dc6-4b68-bb68-2f8d6c37a0a5 " ;
52- static String applicationKey = " /V1e1IvJ8o2+CYSMvOC13kpOhdb6qkd1T6F9UTqNods= " ;
53- static String keyID = " https://cheenaakv.vault.azure.net/keys/AKVTest/884a78a7fb7749fcb973be64e2efe5f0 " ;
54- static String cmkName = " AKV_CMK_JDBC" ;
55- static String cekName = " AKV_CEK_JDBC" ;
56- static String akvTable = " akvTable" ;
50+ static String connectionUrl = " jdbc:sqlserver://localhost;integratedSecurity=true;database=test;columnEncryptionSetting=enabled" ;
51+ static String applicationClientID = " Your Client ID " ;
52+ static String applicationKey = " Your Application Key " ;
53+ static String keyID = " Your Key ID " ;
54+ static String cmkName = " AKV_CMK_JDBC" ;
55+ static String cekName = " AKV_CEK_JDBC" ;
56+ static String akvTable = " akvTable" ;
5757
5858 static String createTableSQL = " create table " + akvTable + " ("
5959 + " PlainNvarcharMax nvarchar(max) null,"
@@ -97,8 +97,6 @@ public class AKV_7_0_0 {
9797 }
9898 }
9999
100-
101-
102100 private static SQLServerKeyVaultAuthenticationCallback tryAuthenticationCallback ()
103101 throws URISyntaxException , SQLServerException {
104102 SQLServerKeyVaultAuthenticationCallback authenticationCallback = new SQLServerKeyVaultAuthenticationCallback () {
@@ -152,13 +150,6 @@ public class AKV_7_0_0 {
152150 testChar(statement);
153151 }
154152
155- /**
156- * Sets up keystore
157- *
158- * @param CUSTOM_AKV_PROVIDER_NAME
159- * @param akvProvider
160- * @throws SQLServerException
161- */
162153 private static void setupKeyStoreProviders (String CUSTOM_AKV_PROVIDER_NAME ,
163154 SQLServerColumnEncryptionKeyStoreProvider akvProvider )
164155 throws SQLServerException {
@@ -167,21 +158,11 @@ public class AKV_7_0_0 {
167158 SQLServerConnection . registerColumnEncryptionKeyStoreProviders(map1);
168159 }
169160
170- /**
171- * Cleans and drops tables
172- *
173- * @throws SQLException
174- */
175161 private static void dropTable (Statement statement ) throws SQLException {
176162 statement. executeUpdate(" if object_id('" + akvTable
177163 + " ','U') is not null" + " drop table " + akvTable);
178164 }
179165
180- /**
181- * Drops CMKs and CEKs
182- *
183- * @throws SQLException
184- */
185166 private static void dropKeys (Statement statement ) throws SQLException {
186167 statement. executeUpdate(
187168 " if exists (SELECT name from sys.column_encryption_keys where name='"
@@ -193,12 +174,6 @@ public class AKV_7_0_0 {
193174 + cmkName + " end" );
194175 }
195176
196- /**
197- * Creates CMK using the keystore
198- *
199- * @param CUSTOM_AKV_PROVIDER_NAME
200- * @throws SQLException
201- */
202177 private static void createCMK (String CUSTOM_AKV_PROVIDER_NAME ,
203178 Statement statement ) throws SQLException {
204179 String _createColumnMasterKeyTemplate = String . format(
@@ -207,13 +182,6 @@ public class AKV_7_0_0 {
207182 statement. execute(_createColumnMasterKeyTemplate);
208183 }
209184
210- /**
211- * Creates CEK
212- *
213- * @param storeProvider
214- * @throws SQLServerException
215- * @throws SQLException
216- */
217185 private static void createCEK (
218186 SQLServerColumnEncryptionKeyStoreProvider storeProvider ,
219187 Statement statement ) throws SQLServerException , SQLException {
@@ -228,14 +196,6 @@ public class AKV_7_0_0 {
228196 statement. execute(cekSql);
229197 }
230198
231- /**
232- *
233- * @param b
234- * byte value
235- * @param length
236- * length of the array
237- * @return
238- */
239199 final static char [] hexChars = {' 0' , ' 1' , ' 2' , ' 3' , ' 4' , ' 5' , ' 6' , ' 7' , ' 8' ,
240200 ' 9' , ' A' , ' B' , ' C' , ' D' , ' E' , ' F' };
241201
@@ -249,11 +209,6 @@ public class AKV_7_0_0 {
249209 return sb. toString();
250210 }
251211
252- /**
253- * Populates the table
254- *
255- * @throws SQLException
256- */
257212 private static void populateCharNormalCase (Connection connection )
258213 throws SQLException {
259214 String sql = " insert into " + akvTable + " values(?,?,?)" ;
0 commit comments