ClientConnection

public interface ClientConnection

Represents the connection between an EnclaveClient and an enclave host. A connection is created when the client calls EnclaveClient.start which then goes on to call EnclaveTransport.connect. There may be multiple clients connected to a single EnclaveTransport and each connection must be able to disambiguate between all of them.

Methods

disconnect
Link copied to clipboard
abstract void disconnect()

Disconnect the client from the EnclaveTransport.

pollMail
Link copied to clipboard
abstract byte[] pollMail()

Send a poll request to the host for retreiving the next available asychronous encrypted mail response from the enclave. If there is one then it is returned here. Otherwise this must return null.

sendMail
Link copied to clipboard
abstract byte[] sendMail(byte[] encryptedMailBytes)

Send the encrypted mail bytes to the host for delivery to the enclave. This method must block until the enclave processes the mail. If the enclave produces a synchronous response mail then that is returned back here.

If the enclave is unable to decrypt the mail bytes then the host must indicate so and this method must throw a MailDecryptionException. The client will catch this and attempt redelivery of the original message by using a fresh new copy of the EnclaveInstanceInfo from the host.

If the enclave itself threw an exception then this method must throw an EnclaveException. The message or may not contain the original message.