@@ -1,14 +1,14 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Interface GatewayInterface |
|
| 4 | - * |
|
| 5 | - * @filesource GatewayInterface.php |
|
| 6 | - * @created 01.04.2016 |
|
| 7 | - * @package chillerlan\Threema |
|
| 8 | - * @author Smiley <[email protected]> |
|
| 9 | - * @copyright 2016 Smiley |
|
| 10 | - * @license MIT |
|
| 11 | - */ |
|
| 3 | + * Interface GatewayInterface |
|
| 4 | + * |
|
| 5 | + * @filesource GatewayInterface.php |
|
| 6 | + * @created 01.04.2016 |
|
| 7 | + * @package chillerlan\Threema |
|
| 8 | + * @author Smiley <[email protected]> |
|
| 9 | + * @copyright 2016 Smiley |
|
| 10 | + * @license MIT |
|
| 11 | + */ |
|
| 12 | 12 | |
| 13 | 13 | namespace chillerlan\Threema; |
| 14 | 14 | |
@@ -1,14 +1,14 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Class GatewayException |
|
| 4 | - * |
|
| 5 | - * @filesource GatewayException.php |
|
| 6 | - * @created 02.04.2016 |
|
| 7 | - * @package chillerlan\Threema |
|
| 8 | - * @author Smiley <[email protected]> |
|
| 9 | - * @copyright 2016 Smiley |
|
| 10 | - * @license MIT |
|
| 11 | - */ |
|
| 3 | + * Class GatewayException |
|
| 4 | + * |
|
| 5 | + * @filesource GatewayException.php |
|
| 6 | + * @created 02.04.2016 |
|
| 7 | + * @package chillerlan\Threema |
|
| 8 | + * @author Smiley <[email protected]> |
|
| 9 | + * @copyright 2016 Smiley |
|
| 10 | + * @license MIT |
|
| 11 | + */ |
|
| 12 | 12 | |
| 13 | 13 | namespace chillerlan\Threema; |
| 14 | 14 | |
@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @filesource threema.php |
|
| 4 | - * @created 02.04.2016 |
|
| 5 | - * @author Smiley <[email protected]> |
|
| 6 | - * @copyright 2016 Smiley |
|
| 7 | - * @license MIT |
|
| 8 | - */ |
|
| 3 | + * @filesource threema.php |
|
| 4 | + * @created 02.04.2016 |
|
| 5 | + * @author Smiley <[email protected]> |
|
| 6 | + * @copyright 2016 Smiley |
|
| 7 | + * @license MIT |
|
| 8 | + */ |
|
| 9 | 9 | |
| 10 | 10 | namespace chillerlan\ThreemaCLI; |
| 11 | 11 | |
@@ -1,58 +1,58 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * |
|
| 4 | - * @filesource callback.php |
|
| 5 | - * @created 02.04.2016 |
|
| 6 | - * @author Smiley <[email protected]> |
|
| 7 | - * @copyright 2016 Smiley |
|
| 8 | - * @license MIT |
|
| 9 | - * |
|
| 10 | - * @todo |
|
| 11 | - * |
|
| 12 | - * Incoming messages and delivery receipts |
|
| 13 | - * |
|
| 14 | - * If your account is operating in end-to-end encrypted mode and incoming messages have been enabled on it, you can |
|
| 15 | - * specify an HTTPS URL callback that will be called whenever an incoming message or delivery receipt arrives for your |
|
| 16 | - * API identity. You can set or change the callback URL in the Threema Gateway administration panel. |
|
| 17 | - * |
|
| 18 | - * Callback parameters |
|
| 19 | - * |
|
| 20 | - * Your callback URL will be called with the following POST parameters (application/x-www-form-urlencoded): |
|
| 21 | - * |
|
| 22 | - * from sender identity (8 characters) |
|
| 23 | - * to your API identity (8 characters, usually starts with '*') |
|
| 24 | - * messageId message ID assigned by the sender (8 bytes, hex encoded) |
|
| 25 | - * date message date set by the sender (UNIX timestamp) |
|
| 26 | - * nonce nonce used for encryption (24 bytes, hex encoded) |
|
| 27 | - * box encrypted message data (max. 4000 bytes, hex encoded) |
|
| 28 | - * mac Message Authentication Code (32 bytes, hex encoded, see below) |
|
| 29 | - * Note that the message first needs to be decrypted before it can be determined whether it is an incoming text message |
|
| 30 | - * or a delivery receipt. |
|
| 31 | - * |
|
| 32 | - * MAC calculation |
|
| 33 | - * |
|
| 34 | - * For each callback, the server includes a mac parameter than can be used to verify the authenticity of the call and |
|
| 35 | - * the included information. This parameter is calculated as follows: |
|
| 36 | - * |
|
| 37 | - * mac = HMAC-SHA256(from || to || messageId || date || nonce || box, secret) |
|
| 38 | - * |
|
| 39 | - * || denotes concatenation. The parameters are concatenated in the same form as they were included in the POST (i.e. |
|
| 40 | - * including any hex encoding, but not including any URL encoding). The secret that is used for the HMAC operation is |
|
| 41 | - * the API authentication secret. |
|
| 42 | - * |
|
| 43 | - * It is recommended that receivers verify the mac parameter before attempting to parse the other parameters and |
|
| 44 | - * decrypt the message. |
|
| 45 | - * |
|
| 46 | - * Callback results and retry |
|
| 47 | - * |
|
| 48 | - * If the connection to your callback URL fails or your callback does not return an HTTP 200 status, the API will retry |
|
| 49 | - * 3 more times in intervals of 5 minutes. If all attempts fail, the message is discarded. |
|
| 50 | - * |
|
| 51 | - * Certificates and cipher suites |
|
| 52 | - * |
|
| 53 | - * The server that hosts the callback URL must use a valid and trusted SSL/TLS certificate (not self-signed). If in |
|
| 54 | - * doubt, please contact customer service and specify the issuing CA of your certificate. |
|
| 55 | - */ |
|
| 3 | + * |
|
| 4 | + * @filesource callback.php |
|
| 5 | + * @created 02.04.2016 |
|
| 6 | + * @author Smiley <[email protected]> |
|
| 7 | + * @copyright 2016 Smiley |
|
| 8 | + * @license MIT |
|
| 9 | + * |
|
| 10 | + * @todo |
|
| 11 | + * |
|
| 12 | + * Incoming messages and delivery receipts |
|
| 13 | + * |
|
| 14 | + * If your account is operating in end-to-end encrypted mode and incoming messages have been enabled on it, you can |
|
| 15 | + * specify an HTTPS URL callback that will be called whenever an incoming message or delivery receipt arrives for your |
|
| 16 | + * API identity. You can set or change the callback URL in the Threema Gateway administration panel. |
|
| 17 | + * |
|
| 18 | + * Callback parameters |
|
| 19 | + * |
|
| 20 | + * Your callback URL will be called with the following POST parameters (application/x-www-form-urlencoded): |
|
| 21 | + * |
|
| 22 | + * from sender identity (8 characters) |
|
| 23 | + * to your API identity (8 characters, usually starts with '*') |
|
| 24 | + * messageId message ID assigned by the sender (8 bytes, hex encoded) |
|
| 25 | + * date message date set by the sender (UNIX timestamp) |
|
| 26 | + * nonce nonce used for encryption (24 bytes, hex encoded) |
|
| 27 | + * box encrypted message data (max. 4000 bytes, hex encoded) |
|
| 28 | + * mac Message Authentication Code (32 bytes, hex encoded, see below) |
|
| 29 | + * Note that the message first needs to be decrypted before it can be determined whether it is an incoming text message |
|
| 30 | + * or a delivery receipt. |
|
| 31 | + * |
|
| 32 | + * MAC calculation |
|
| 33 | + * |
|
| 34 | + * For each callback, the server includes a mac parameter than can be used to verify the authenticity of the call and |
|
| 35 | + * the included information. This parameter is calculated as follows: |
|
| 36 | + * |
|
| 37 | + * mac = HMAC-SHA256(from || to || messageId || date || nonce || box, secret) |
|
| 38 | + * |
|
| 39 | + * || denotes concatenation. The parameters are concatenated in the same form as they were included in the POST (i.e. |
|
| 40 | + * including any hex encoding, but not including any URL encoding). The secret that is used for the HMAC operation is |
|
| 41 | + * the API authentication secret. |
|
| 42 | + * |
|
| 43 | + * It is recommended that receivers verify the mac parameter before attempting to parse the other parameters and |
|
| 44 | + * decrypt the message. |
|
| 45 | + * |
|
| 46 | + * Callback results and retry |
|
| 47 | + * |
|
| 48 | + * If the connection to your callback URL fails or your callback does not return an HTTP 200 status, the API will retry |
|
| 49 | + * 3 more times in intervals of 5 minutes. If all attempts fail, the message is discarded. |
|
| 50 | + * |
|
| 51 | + * Certificates and cipher suites |
|
| 52 | + * |
|
| 53 | + * The server that hosts the callback URL must use a valid and trusted SSL/TLS certificate (not self-signed). If in |
|
| 54 | + * doubt, please contact customer service and specify the issuing CA of your certificate. |
|
| 55 | + */ |
|
| 56 | 56 | |
| 57 | 57 | |
| 58 | 58 | |