public class E2EHelper extends Object
Modifier and Type | Class and Description |
---|---|
class |
E2EHelper.ReceiveMessageResult |
Constructor and Description |
---|
E2EHelper(APIConnector apiConnector,
byte[] privateKey) |
Modifier and Type | Method and Description |
---|---|
E2EHelper.ReceiveMessageResult |
receiveMessage(String threemaId,
String messageId,
byte[] box,
byte[] nonce,
Path outputFolder)
Decrypt a Message and download the blobs of the Message (e.g.
|
String |
sendFileMessage(String threemaId,
File fileMessageFile,
File thumbnailMessagePath)
Encrypt a file message and send it to the given recipient.
|
String |
sendImageMessage(String threemaId,
String imageFilePath)
Encrypt an image message and send it to the given recipient.
|
String |
sendTextMessage(String threemaId,
String text)
Encrypt a text message and send it to the given recipient.
|
public E2EHelper(APIConnector apiConnector, byte[] privateKey)
public String sendTextMessage(String threemaId, String text) throws Exception
threemaId
- target Threema IDtext
- the text to sendException
public String sendImageMessage(String threemaId, String imageFilePath) throws NotAllowedException, IOException, InvalidKeyException
threemaId
- target Threema IDimageFilePath
- path to read image data fromNotAllowedException
IOException
InvalidKeyException
public String sendFileMessage(String threemaId, File fileMessageFile, File thumbnailMessagePath) throws InvalidKeyException, IOException, NotAllowedException
threemaId
- target Threema IDfileMessageFile
- the file to be sentthumbnailMessagePath
- file for thumbnail; if not set, no thumbnail will be sentInvalidKeyException
IOException
NotAllowedException
public E2EHelper.ReceiveMessageResult receiveMessage(String threemaId, String messageId, byte[] box, byte[] nonce, Path outputFolder) throws IOException, InvalidKeyException, MessageParseException
threemaId
- Threema ID of the sendermessageId
- Message IDbox
- Encrypted box data of the file/image messagenonce
- Nonce that was used for message encryptionoutputFolder
- Output folder for storing decrypted images/filesIOException
InvalidKeyException
MessageParseException
Copyright © 2015 Threema GmbH, Staldenbachstrasse 11, 8808 Pfäffikon SZ, Schweiz. All rights reserved.