-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
45 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,143 +1,65 @@ | ||
**Dear visitor** | ||
|
||
**This repository is no longer maintained.** | ||
|
||
**To download the latest version of the Threema Getway SDK please go to:** | ||
|
||
https://gateway.threema.ch/en/developer/sdk-java | ||
|
||
|
||
# msgapi-sdk-java | ||
Version: 1.1.2 | ||
Version: 1.1.3 | ||
|
||
## Console client usage | ||
###Local operations (no network communication) | ||
####Encrypt | ||
|
||
```shell | ||
java -jar threema-msgapi-tool.jar -e <privateKey> <publicKey> | ||
``` | ||
|
||
java -jar threema-msgapi-tool.jar -e <privateKey> <publicKey> | ||
Encrypt standard input using the given sender private key and recipient public key. Prints two lines to standard output: first the nonce (hex), and then the box (hex). | ||
|
||
####Decrypt | ||
|
||
```shell | ||
java -jar threema-msgapi-tool.jar -d <privateKey> <publicKey> <nonce> | ||
``` | ||
|
||
java -jar threema-msgapi-tool.jar -d <privateKey> <publicKey> <nonce> | ||
Decrypt standard input using the given recipient private key and sender public key. The nonce must be given on the command line, and the box (hex) on standard input. Prints the decrypted message to standard output. | ||
|
||
####Hash Email Address | ||
|
||
```shell | ||
java -jar threema-msgapi-tool.jar -h -e <email> | ||
``` | ||
|
||
java -jar threema-msgapi-tool.jar -h -e <email> | ||
Hash an email address for identity lookup. Prints the hash in hex. | ||
|
||
####Hash Phone Number | ||
|
||
```shell | ||
java -jar threema-msgapi-tool.jar -h -p <phoneNo> | ||
``` | ||
|
||
java -jar threema-msgapi-tool.jar -h -p <phoneNo> | ||
Hash a phone number for identity lookup. Prints the hash in hex. | ||
|
||
####Generate Key Pair | ||
|
||
```shell | ||
java -jar threema-msgapi-tool.jar -g <privateKeyFile> <publicKeyPath> | ||
``` | ||
|
||
java -jar threema-msgapi-tool.jar -g <privateKeyFile> <publicKeyPath> | ||
Generate a new key pair and write the private and public keys to the respective files (in hex). | ||
|
||
####Derive Public Key | ||
|
||
```shell | ||
java -jar threema-msgapi-tool.jar -p <privateKey> | ||
``` | ||
|
||
java -jar threema-msgapi-tool.jar -p <privateKey> | ||
Derive the public key that corresponds with the given private key. | ||
|
||
###Network operations | ||
####Send Simple Message | ||
|
||
```shell | ||
java -jar threema-msgapi-tool.jar -s <to> <from> <secret> | ||
``` | ||
|
||
java -jar threema-msgapi-tool.jar -s <to> <from> <secret> | ||
Send a message from standard input with server-side encryption to the given ID. 'from' is the API identity and 'secret' is the API secret. Returns the message ID on success. | ||
|
||
####Send End-to-End Encrypted Text Message | ||
|
||
```shell | ||
java -jar threema-msgapi-tool.jar -S <to> <from> <secret> <privateKey> | ||
``` | ||
|
||
java -jar threema-msgapi-tool.jar -S <to> <from> <secret> <privateKey> | ||
Encrypt standard input and send the message to the given ID. 'from' is the API identity and 'secret' is the API secret. Prints the message ID on success. | ||
|
||
####Send End-to-End Encrypted Image Message | ||
|
||
```shell | ||
java -jar threema-msgapi-tool.jar -S -i <to> <from> <secret> <privateKey> <imageFilePath> | ||
``` | ||
|
||
java -jar threema-msgapi-tool.jar -S -i <to> <from> <secret> <privateKey> <imageFilePath> | ||
Encrypt standard input and send the message to the given ID. 'from' is the API identity and 'secret' is the API secret. Prints the message ID on success. | ||
|
||
####Send End-to-End Encrypted File Message | ||
|
||
```shell | ||
java -jar threema-msgapi-tool.jar -S -f <to> <from> <secret> <privateKey> <file> [thumbnail] | ||
``` | ||
|
||
java -jar threema-msgapi-tool.jar -S -f <to> <from> <secret> <privateKey> <file> [thumbnail] | ||
Encrypt the file (and thumbnail) and send a file message to the given ID. 'from' is the API identity and 'secret' is the API secret. Prints the message ID on success. | ||
|
||
####ID Lookup By Email Address | ||
|
||
```shell | ||
java -jar threema-msgapi-tool.jar -l -e <email> <from> <secret> | ||
``` | ||
|
||
java -jar threema-msgapi-tool.jar -l -e <email> <from> <secret> | ||
Lookup the ID linked to the given email address (will be hashed locally). | ||
|
||
####ID Lookup By Phone Number | ||
|
||
```shell | ||
java -jar threema-msgapi-tool.jar -l -p <phoneNo> <from> <secret> | ||
``` | ||
|
||
java -jar threema-msgapi-tool.jar -l -p <phoneNo> <from> <secret> | ||
Lookup the ID linked to the given phone number (will be hashed locally). | ||
|
||
####Fetch Public Key | ||
|
||
```shell | ||
java -jar threema-msgapi-tool.jar -l -k <id> <from> <secret> | ||
``` | ||
|
||
java -jar threema-msgapi-tool.jar -l -k <id> <from> <secret> | ||
Lookup the public key for the given ID. | ||
|
||
####Fetch Capability | ||
|
||
```shell | ||
java -jar threema-msgapi-tool.jar -c <id> <from> <secret> | ||
``` | ||
|
||
java -jar threema-msgapi-tool.jar -c <id> <from> <secret> | ||
Fetch the capability of a Threema ID | ||
|
||
####Decrypt and download | ||
|
||
```shell | ||
java -jar threema-msgapi-tool.jar -D <id> <from> <secret> <privateKey> <messageId> <nonce> [outputFolder] | ||
``` | ||
|
||
Decrypt a box (box from the stdin) message and download (if the message is a image or file message) the file(s) to the defined directory | ||
|
||
|
||
#### Remaining credits | ||
|
||
```shell | ||
java -jar threema-msgapi-tool.jar -C <from> <secret> | ||
``` | ||
|
||
Fetch remaining credits | ||
java -jar threema-msgapi-tool.jar -D <id> <from> <secret> <privateKey> <messageId> <nonce> [outputFolder] | ||
Decrypt a box (box from the stdin) message and download (if the message is a image or file message) the file(s) to the defined directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,34 +4,16 @@ | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.sonatype.oss</groupId> | ||
<artifactId>oss-parent</artifactId> | ||
<version>7</version> | ||
</parent> | ||
|
||
<groupId>ch.threema.apitool</groupId> | ||
<artifactId>msgapi-sdk-java</artifactId> | ||
<version>1.1.2</version> | ||
<version>1.1.3</version> | ||
<name>Threema MsgApi SDK</name> | ||
|
||
<issueManagement> | ||
<system>github issues</system> | ||
<url>https://github.com/threema-ch/threema-msgapi-sdk-java/issues</url> | ||
</issueManagement> | ||
|
||
<properties> | ||
<source.encoding>UTF-8</source.encoding> | ||
<project.build.sourceEncoding>${source.encoding}</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>${source.encoding}</project.reporting.outputEncoding> | ||
</properties> | ||
|
||
<scm> | ||
<connection>scm:https://github.com/threema-ch/threema-msgapi-sdk-java.git</connection> | ||
<developerConnection>scm:git:[email protected]:threema-ch/threema-msgapi-sdk-java.git</developerConnection> | ||
<url>https://github.com/threema-ch/threema-msgapi-sdk-java</url> | ||
</scm> | ||
|
||
<organization> | ||
<name>Threema GmbH, Staldenbachstrasse 11, 8808 Pfäffikon SZ, Schweiz</name> | ||
<url>https://www.threema.ch</url> | ||
|
@@ -78,54 +60,49 @@ | |
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.3</version> | ||
<configuration> | ||
<source>8</source> | ||
<target>8</target> | ||
<encoding>${source.encoding}</encoding> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<artifactId>maven-resources-plugin</artifactId> | ||
<version>2.5</version> | ||
<configuration> | ||
<encoding>${source.encoding}</encoding> | ||
<source>1.8</source> | ||
<target>1.8</target> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<!-- Build an executable JAR --> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<version>2.3.1</version> | ||
<version>2.6</version> | ||
<configuration> | ||
<archive> | ||
<manifest> | ||
<addClasspath>true</addClasspath> | ||
<classpathPrefix>lib/</classpathPrefix> | ||
<mainClass>ch.threema.apitool.ConsoleMain</mainClass> | ||
<addDefaultImplementationEntries>true</addDefaultImplementationEntries> | ||
<mainClass>ch.threema.apitool.Console</mainClass> | ||
</manifest> | ||
</archive> | ||
</configuration> | ||
</plugin> | ||
<!-- dependencies to jar --> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<version>2.1</version> | ||
<artifactId>maven-assembly-plugin</artifactId> | ||
<version>2.5.4</version> | ||
<configuration> | ||
<archive> | ||
<manifest> | ||
<mainClass>ch.threema.apitool.ConsoleMain</mainClass> | ||
</manifest> | ||
</archive> | ||
<descriptorRefs> | ||
<descriptorRef>jar-with-dependencies</descriptorRef> | ||
</descriptorRefs> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>copy-dependencies</id> | ||
<id>make-assembly</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>copy-dependencies</goal> | ||
<goal>assembly</goal> | ||
</goals> | ||
<configuration> | ||
<outputDirectory>${project.build.directory}/lib</outputDirectory> | ||
<overWriteReleases>false</overWriteReleases> | ||
<overWriteSnapshots>false</overWriteSnapshots> | ||
<overWriteIfNewer>true</overWriteIfNewer> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters