\Threema\MsgApi\HelpersE2EHelper

Summary

Methods
Properties
Constants
__construct()
sendTextMessage()
sendImageMessage()
sendFileMessage()
receiveMessage()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
fetchPublicKeyAndCheckCapability()
downloadFile()
$connection
$cryptTool
$privateKey
N/A

Properties

$privateKey

$privateKey : string

Type

string — (bin)

Methods

sendTextMessage()

sendTextMessage(string  $threemaId, string  $text) : \Threema\MsgApi\Commands\Results\SendE2EResult

Crypt a text message and send it to the threemaId

Parameters

string $threemaId
string $text

Throws

\Threema\Core\Exception

Returns

\Threema\MsgApi\Commands\Results\SendE2EResult

sendImageMessage()

sendImageMessage(string  $threemaId, string  $imagePath) : \Threema\MsgApi\Commands\Results\SendE2EResult

Crypt a image file, upload the blob and send the image message to the threemaId

Parameters

string $threemaId
string $imagePath

Throws

\Threema\Core\Exception

Returns

\Threema\MsgApi\Commands\Results\SendE2EResult

sendFileMessage()

sendFileMessage(string  $threemaId, string  $filePath, null|string  $thumbnailPath = null) : \Threema\MsgApi\Commands\Results\SendE2EResult

Crypt a file (and thumbnail if given), upload the blob and send it to the given threemaId

Parameters

string $threemaId
string $filePath
null|string $thumbnailPath

Throws

\Threema\Core\Exception

Returns

\Threema\MsgApi\Commands\Results\SendE2EResult

receiveMessage()

receiveMessage(string  $threemaId, string  $messageId, string  $box, string  $nonce, string|null  $outputFolder = null, \Closure  $downloadMessage = null) : \Threema\MsgApi\Helpers\ReceiveMessageResult

Encrypt a message and download the files of the message to the $outputFolder

Parameters

string $threemaId
string $messageId
string $box

box as binary string

string $nonce

nonce as binary string

string|null $outputFolder

folder for storing the files

\Closure $downloadMessage

Throws

\Threema\Core\Exception
\Threema\MsgApi\Exceptions\BadMessageException
\Threema\MsgApi\Exceptions\DecryptionFailedException
\Threema\MsgApi\Exceptions\UnsupportedMessageTypeException

Returns

\Threema\MsgApi\Helpers\ReceiveMessageResult

fetchPublicKeyAndCheckCapability()

fetchPublicKeyAndCheckCapability(string  $threemaId, \Closure  $capabilityCheck = null) : string

Fetch a public key and check the capability of the threemaId

Parameters

string $threemaId
\Closure $capabilityCheck

Throws

\Threema\Core\Exception

Returns

string —

Public key as binary