Decryption Hook

The RPC protocols always check the encrypted message flag in the header against the enabled or disabled state of the encryption feature. If a message is received that does not match the expected state, the message is rejected and the appropriate exception is raised.

The rpcDecryptMessage user-supplied Decryption hook function is called when RPC encryption is enabled on a node. The rpcDecryptMessage function has the following format.

int JOMAPI rpcDecryptMessage(const void    *inData,
                             unsigned      inLength,
                             void          **outData,
                             unsigned      *pOutLength,
                             int           userData);

The decryption hook is called by the Jade client or server-side RPC module after obtaining a message from the network layer.

After calling your decryption routine, a CRC is generated against the data part of the message and compared to the CRC in the header. A CRC mismatch results in the message being rejected and an error raised. The rpcDecryptMessage function returns the following values.

Value Description
0 The decryption routine was successful
Non-zero The decryption routine failed