Package org.signal.libsignal.hsmenclave
Class HsmEnclaveClient
- java.lang.Object
-
- org.signal.libsignal.hsmenclave.HsmEnclaveClient
-
- All Implemented Interfaces:
NativeHandleGuard.Owner
public class HsmEnclaveClient extends java.lang.Object implements NativeHandleGuard.Owner
HsmEnclaveClient provides bindings to interact with Signal's HSM-backed enclave. Interaction with the enclave is done over a websocket, which is handled by the client. Once the websocket has been initiated, the client establishes a connection in the following manner:- send HsmEnclaveClient.initialRequest()
- receive a response and pass to HsmEnclaveClient.completeHandshake()
-
-
Constructor Summary
Constructors Constructor Description HsmEnclaveClient(byte[] public_key, java.util.List<byte[]> code_hashes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcompleteHandshake(byte[] handshakeResponse)Called by client upon receipt of first message from HSM enclave, to complete handshake.byte[]establishedRecv(byte[] receivedCiphertext)Called by client after completeHandshake has succeeded, to decrypt a received message.byte[]establishedSend(byte[] plaintextToSend)Called by client after completeHandshake has succeeded, to encrypt a message to send.protected voidfinalize()byte[]initialRequest()Initial request to send to HSM enclave, to begin handshake.longunsafeNativeHandleWithoutGuard()
-
-
-
Method Detail
-
finalize
protected void finalize()
- Overrides:
finalizein classjava.lang.Object
-
unsafeNativeHandleWithoutGuard
public long unsafeNativeHandleWithoutGuard()
- Specified by:
unsafeNativeHandleWithoutGuardin interfaceNativeHandleGuard.Owner
-
initialRequest
public byte[] initialRequest()
Initial request to send to HSM enclave, to begin handshake.
-
completeHandshake
public void completeHandshake(byte[] handshakeResponse)
Called by client upon receipt of first message from HSM enclave, to complete handshake.
-
establishedSend
public byte[] establishedSend(byte[] plaintextToSend)
Called by client after completeHandshake has succeeded, to encrypt a message to send.
-
establishedRecv
public byte[] establishedRecv(byte[] receivedCiphertext)
Called by client after completeHandshake has succeeded, to decrypt a received message.
-
-