Download the PHP package rugk/threema-msgapi-sdk-php without Composer

On this page you can find all versions of the php package rugk/threema-msgapi-sdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package threema-msgapi-sdk-php

Threema Gateway PHP SDK

Version: 1.2.0

Build Status Code Climate Scrutinizer Code Quality SensioLabsInsight Codacy Badge

Notes about this version

This is a fork of the original repo after it was announced that the GitHub-version is no longer maintained by Threema. As this is the community version of the Threema Gateway PHP SDK it may contain additional changes which are not yet included in the official downloadable version on the Threema website. If you are looking for a simple mirror of the downloadable Threema version you can switch to the branch official.
More information is avaliable in the wiki.

An automatically created documentation of this SDK can be found on GitHub Pages.

The contributors of this repository are not affiliated with Threema or the Threema GmbH.

Installation

If you want to check whether your server meets the requirements and everything is configured properly you can execute threema-msgapi-tool.php without any parameters on the console or point your browser to the location where it is saved on your server.

If you want to use this library in your own product it is recommend to use Composer and require rugk/threema-msgapi-sdk-php.

SDK usage

Creating a connection

Creating a connection with advanced options

Attention: These settings change internal values of the TLS connection. Choosing wrong settings can weaken the TLS connection or prevent a successful connection to the server. Use them with care!

Each of the additional options shown below is optional. You can leave it out or use null to use the default value determinated by cURL for this option.

If you want to get a list of all ciphers you can use have a look at the SSLLabs scan, at the list of all available OpenSSL ciphers and the comparison table by Mozilla which also has some suggestions for good ciphers you should use.

Note: For pinnedKey to work you must install cURL 7.39 or higher. It is also recommend to use PHP 7.0.7 or higher if you want to support this feature, but it is not required. You can test whether it works by specifying an invalid pin.

Sending a text message to a Threema ID (Simple Mode)

Sending a text message to a Threema ID (E2E Mode)

Sending a file message to a Threema ID (E2E Mode)

Console client usage

Local operations (no network communication)

Encrypt

Encrypt standard input using the given sender private key and recipient public key. Two lines to standard output: first the nonce (hex), and then the box (hex).

Decrypt

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

Hash an email address for identity lookup. Prints the hash in hex.

Hash Phone Number

Hash a phone number for identity lookup. Prints the hash in hex.

Generate Key Pair

Generate a new key pair and write the private and public keys to the respective files (in hex).

Derive Public Key

Derive the public key that corresponds with the given private key.

Network operations

Send Simple Message

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. the message ID on success.

Send End-to-End Encrypted Text Message

Encrypt standard input and send the text message to the given ID. <from> is the API identity and <secret> is the API secret. Prints the message ID on success.

Send a End-to-End Encrypted Image Message

Encrypt the image file 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 a End-to-End Encrypted File Message

Encrypt the file (and thumbnail if given) 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.

ID-Lookup By Email Address

Lookup the ID linked to the given email address (will be hashed locally).

ID-Lookup By Phone Number

Lookup the ID linked to the given phone number (will be hashed locally).

Fetch Public Key

Lookup the public key for the given ID.

Fetch Capability

Fetch the capabilities of a Threema ID.

Decrypt a Message and download the Files

Decrypt a box (must be provided on stdin) message and download (if the message is an image or file message) the file(s) to the given <outputFolder> folder.

Remaining credits

Fetch remaining credits.

Contributing

Nice to see you want to contribute. We may periodically send patches to Threema to make it possible for them to implement them in the official SDK version.
You can find more information in our wiki.

Implementations

Looking for some implementations? Have a look at the wiki.

Other platforms (Java and Python)

All repositories on GitHub are no longer maintained by the Threema GmbH. However, the community has forked the repositories of all platforms and they are now maintained unofficially.

You can find the Java repository at simmac/threema-msgapi-sdk-java
and the Python repository at lgrahl/threema-msgapi-sdk-python.


All versions of threema-msgapi-sdk-php with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rugk/threema-msgapi-sdk-php contains the following files

Loading the files please wait ....