PHP composer package for TrustOcean API call.

v0.1.3 2018-12-25 17:00 UTC

This package is auto-updated.

Last update: 2020-06-25 20:54:43 UTC


Composer package implementation for TrustOcean API.

Raw document provided by TrustOcean can be found in here, as well as their product definition.

Product list will update once TrustOcean updated it first.

Feel free to fork and open pull request to this package. Contributes are welcome.


composer require deamwork/trustoceanphp


Make a json config file.

vi config.json

Config example

level can be partner or developer, will uses different API base uri and product definitions.

You can always set your own base API uri, fill it to api_base.

Don't forget to fill your TrustOcean username and password. It won't store and it only send to TrustOcean API. Details can be found in security section.

  "account": {
    "level": "developer",
    "username": "",
    "password": ""
  "trustocean": {
    "api_base": null

then, reference use TrustOcean\Core\Actions as TOAPI in your workflow.


Create new order

$flow = new TOAPI('/path/to/your/config.json');
$order = $flow->createOrder('TrustOcean Encryption365 SSL', 'quarterly', 3);
$order_id = $order['order_id'];

Add more SANs

$flow->addSANs($order_id, 3);

Upload CSR

$flow->uploadCSR($order_id, "CSR TEXT GOES HERE");

Set domain(s)

$flow->addDomains($order_id, [
    'a.domain.tld', 'b.domain.tld', 'c.domain.tld',
    'd.domain.tld', 'e.domain.tld', 'f.domain.tld',

Remove domain(s)

$flow->removeDomain($order_id, [
    'd.domain.tld', 'e.domain.tld', 'f.domain.tld',

Get order detail(s)


Change verification method

$flow->changeDCVMethod($order_id, [
    'a.domain.tld' => 'admin@domain.tld',
    'b.domain.tld' => 'CSR_CNAME_HASH',
    'c.domain.tld' => 'HTTP_CSR_HASH',

Call CA to verify your domain


... or ...


After verification, get your certs

$cert = $flow->getCertDetails($order_id);
print_r($cert['cert_code'], true); // get your certificate
print_r($cert['ca_code'], true);   // get CA certificate

Wants reissue?


Then redo the flow.


right in the todo list.


See CONTRIBUTING for more information.


This library only talks to the TrustOcean API, it will not store nor send your any information to any third party.

In fact? This library won't store anything

If you discover any security related issues, feel free to open a new issue and I will mark it as "Security" ASAP.


This project is open-sourced under MIT license.

This demand is required by TrustOcean, which to be honest, I prefer to choose BSD-3...