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

## Class SQLServerAASEnclaveProvider

- java.lang.Object
- - com.microsoft.sqlserver.jdbc.SQLServerAASEnclaveProvider

    public class SQLServerAASEnclaveProvider
    extends Object

Provides the implementation of the AAS Enclave Provider. The enclave provider encapsulates the client-side implementation details of the enclave attestation protocol.

### Field Summary

Fields
`static String` `SDPE1` sp_describe_parameter_encryption stored procedure with 2 params
`static String` `SDPE2` sp_describe_parameter_encryption stored procedure with 3 params

### Constructor Summary

Constructors
`SQLServerAASEnclaveProvider()`

### Method Summary

All Methods Instance Methods Concrete Methods Default Methods
`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`

### Field Detail

#### SDPE1

    public static final String SDPE1

sp_describe_parameter_encryption stored procedure with 2 params

See Also:
  Constant Field Values

#### SDPE2

    public static final String SDPE2

sp_describe_parameter_encryption stored procedure with 3 params

See Also:
  Constant Field Values

### Constructor Detail

#### SQLServerAASEnclaveProvider

    public SQLServerAASEnclaveProvider()

### Method Detail

#### 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

    public 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

    public 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

    public 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

    public 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