Module com.microsoft.sqlserver.jdbc
Package com.microsoft.sqlserver.jdbc

# Class SQLServerVSMEnclaveProvider

java.lang.Object
com.microsoft.sqlserver.jdbc.SQLServerVSMEnclaveProvider

public class SQLServerVSMEnclaveProvider extends Object
Provides the implementation of the VSM Enclave Provider. The enclave provider encapsulates the client-side implementation details of the enclave attestation protocol.

## Constructor Summary

Constructors
Constructor
Description
`SQLServerVSMEnclaveProvider()`
default constructor

## Method Summary

Modifier and Type
Method
Description
`ArrayList<byte[]>`
`createEnclaveSession(SQLServerConnection connection, SQLServerStatement statement, String userSql, String preparedTypeDefinitions, com.microsoft.sqlserver.jdbc.Parameter[] params, ArrayList<String> parameterNames)`
`default ResultSet`
`executeSDPEv1(PreparedStatement stmt, String userSql, String preparedTypeDefinitions)`
Execute sp_describe_parameter_encryption
`default ResultSet`
`executeSDPEv2(PreparedStatement stmt, String userSql, String preparedTypeDefinitions, com.microsoft.sqlserver.jdbc.BaseAttestationRequest req)`
Execute sp_describe_parameter_encryption for AEv2
`void`
`getAttestationParameters(String url)`
`default byte[]`
`getEnclavePackage(String userSQL, ArrayList<byte[]> enclaveCEKs)`
Get the Enclave package
`com.microsoft.sqlserver.jdbc.EnclaveSession`
`getEnclaveSession()`
`void`
`invalidateEnclaveSession()`
`default void`
`processSDPEv1(String userSql, String preparedTypeDefinitions, com.microsoft.sqlserver.jdbc.Parameter[] params, ArrayList<String> parameterNames, SQLServerConnection connection, SQLServerStatement sqlServerStatement, PreparedStatement stmt, ResultSet rs, ArrayList<byte[]> enclaveRequestedCEKs)`
Process result from sp_describe_parameter_encryption

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### SQLServerVSMEnclaveProvider

public SQLServerVSMEnclaveProvider()
default constructor

## Method Details

### getAttestationParameters

public void getAttestationParameters(String url) throws SQLServerException

Throws:
  `SQLServerException`

### createEnclaveSession

public ArrayList<byte[]> createEnclaveSession(SQLServerConnection connection, SQLServerStatement statement, String userSql, String preparedTypeDefinitions, com.microsoft.sqlserver.jdbc.Parameter[] params, ArrayList<String> parameterNames) throws SQLServerException

Throws:
  `SQLServerException`

### invalidateEnclaveSession

public void invalidateEnclaveSession()

### getEnclaveSession

public com.microsoft.sqlserver.jdbc.EnclaveSession getEnclaveSession()

### getEnclavePackage

default byte[] getEnclavePackage(String userSQL, ArrayList<byte[]> enclaveCEKs) throws SQLServerException
Get the Enclave package

Parameters:
  `userSQL` - user sql
  `enclaveCEKs` - enclave CEKs
Returns:
  the enclave package
Throws:
  `SQLServerException` - if error

### executeSDPEv2

default ResultSet executeSDPEv2(PreparedStatement stmt, String userSql, String preparedTypeDefinitions, com.microsoft.sqlserver.jdbc.BaseAttestationRequest req) throws SQLException, IOException
Execute sp_describe_parameter_encryption for AEv2

Parameters:
  `stmt` - statement
  `userSql` - user sql
  `preparedTypeDefinitions` - prepared type definitions
  `req` - request
Returns:
  result set
Throws:
  `SQLException` - if error
  `IOException` - if IO exception

### executeSDPEv1

default ResultSet executeSDPEv1(PreparedStatement stmt, String userSql, String preparedTypeDefinitions) throws SQLException
Execute sp_describe_parameter_encryption

Parameters:
  `stmt` - stmt
  `userSql` - user sql
  `preparedTypeDefinitions` - prepared type definitions
Returns:
  result set
Throws:
  `SQLException` - if error

### processSDPEv1

default void processSDPEv1(String userSql, String preparedTypeDefinitions, com.microsoft.sqlserver.jdbc.Parameter[] params, ArrayList<String> parameterNames, SQLServerConnection connection, SQLServerStatement sqlServerStatement, PreparedStatement stmt, ResultSet rs, ArrayList<byte[]> enclaveRequestedCEKs) throws SQLException
Process result from sp_describe_parameter_encryption

Parameters:
  `userSql` - user sql
  `preparedTypeDefinitions` - prepared type definitions
  `params` - params
  `parameterNames` - param names
  `connection` - connection
  `sqlServerStatement` - sqlServerStatement
  `stmt` - statement
  `rs` - result set
  `enclaveRequestedCEKs` - enclave requested CEKs
Throws:
  `SQLException` - if error