PHPackages                             securibox/cloudagents - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. securibox/cloudagents

ActiveLibrary[API Development](/categories/api)

securibox/cloudagents
=====================

API wrapper for Securibox Cloud Agents.

1.5.0(11mo ago)38.2k2[1 PRs](https://github.com/Securibox/cloudagents-php/pulls)GPL-3.0-onlyPHPPHP &gt;=7.3CI passing

Since Aug 9Pushed 3mo ago4 watchersCompare

[ Source](https://github.com/Securibox/cloudagents-php)[ Packagist](https://packagist.org/packages/securibox/cloudagents)[ Docs](https://github.com/Securibox/cloudagents-php)[ RSS](/packages/securibox-cloudagents/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (19)Used By (0)

cloudagents-php
===============

[](#cloudagents-php)

[![Packagist Version](https://camo.githubusercontent.com/15d1f75905dca9bcbafb87045a8ebfdb6deb3878ddfa678b5069b0533dcf261b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7061636b61676973742d312e302e322d626c75652e737667)](https://packagist.org/packages/securibox/cloudagents)

A PHP client library for the [Securibox Cloud Agents API](https://sca.securibox.eu)

Install Package
---------------

[](#install-package)

Securibox Cloud Agent PHP wrapper is installed via [Composer](http://getcomposer.org). Simply run the following command:

```
composer require securibox/cloudagents
```

#### Alternative: Install package from zip

[](#alternative-install-package-from-zip)

If you are not using Composer, simply download and install the **[latest packaged release of the library as a zip](https://github.com/Securibox/cloudagents-php/archive/master.zip)**.

Authentication
--------------

[](#authentication)

In order to secure the Securibox Cloud Agents API, three mechanisms have been implemented. Here is a brief overview of the three mechanisms as well as code snippets to help you integrate the correct mechanism in order to call the APIs.

Basic API Authentication w/ TLS
-------------------------------

[](#basic-api-authentication-w-tls)

Basic API authentication is the easiest of the three to implement offering the lowest security options of the common protocols. This mechanism is usually advised for testing purposes in order to test the APIs and only requires Securibox to provide a username and password.

```
use Securibox\CloudAgents\Documents\ApiClient;

$client = ApiClient::AuthenticationBasic("username", "password");
```

### SSL Client Certificate Authentication

[](#ssl-client-certificate-authentication)

The SSL client certification is a mechanism allowing your application to authenticate itself with the Securibox Cloud Agents (SCA) servers. In this case, your application will send its SSL certificate after verifing the SCA server identity. Then, the client and server use both certificates to generate a unique key used to sign requests sent between them.

This kind of authentication is implemented when the customer call your servers that will then call the Securibox Cloud Agents API.

In order to use this type of authentication, Securibox will provide a PEM certificate file containing a passphrase protected private key and a public key.

```
use Securibox\CloudAgents\Documents\ApiClient;

$client = ApiClient::SslClientCertificate("C:\Path\to\PEM Certificate", "PEM pass phrase");
```

### JSON Web Token Authentication

[](#json-web-token-authentication)

[JSON Web Token (JWT)](https://jwt.io) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. This information can be verified and trusted because it is digitally signed. JWTs can be signed using a public/private key pair using RS256 (RSA PKCS#1 signature with SHA-256).

This kind of authentication is implemented when the customer calls directly the Securibox Cloud Agents API together with [cross-origin resource sharing (CORS)](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing).

In order to use this type of authentication, Securibox will provide a passphrase protected RSA private key in PEM file (.pem).

```
use Securibox\CloudAgents\Documents\ApiClient;

$client = ApiClient::Jwt("C:\Path\to\PEM private key", "PEM pass phrase");
```

Getting started
---------------

[](#getting-started)

The following is the minimum needed code to list all agent details and fields:

```
