Giter Site home page Giter Site logo

xolphin-api-php's Introduction

Xolphin API wrapper for PHP

xolphin-php-api is a library which allows quick integration of the Xolphin REST API in PHP to automated ordering, issuance and installation of SSL Certificates.

About Xolphin

Xolphin is the largest supplier of SSL Certificates and Digital Signatures in the Netherlands. Xolphin has a professional team providing reliable support and rapid issuance of SSL Certificates at an affordable price from industry leading brands such as Comodo, GeoTrust, GlobalSign, Thawte and Symantec.

Library installation

Library can be installed via Composer

composer require xolphin/xolphin-api-php

And updated via

composer update xolphin/xolphin-api-php

Usage

Client initialization

<?php

require 'vendor/autoload.php';

$client = new Xolphin\Client('<username>', '<password>');

Requests

Get list of requests

$requests = $client->request()->all();
foreach($requests as $request) {
    echo $request->id . "\n";
}

Get request by ID

$request = $client->request()->get(1234);
echo $request->id;

Request certificate

$products = $client->support()->products();

// request Comodo EssentialSSL certificate for 1 year
$request = $client->request()->create($products[1]->id, 1, '<csr_string>', 'EMAIL')
    ->setAddress("Address")
    ->setApproverFirstName("FirstName")
    ->setApproverLastName("LastName")
    ->setApproverPhone("+12345678901")
    ->setZipcode("123456")
    ->setCity("City")
    ->setCompany("Company")
    ->setApproverEmail('[email protected]')
    //currently available languages: en, de, fr, nl
    ->setLanguage('en')
    ->addSubjectAlternativeNames('test1.domain.com')
    ->addSubjectAlternativeNames('test2.domain.com')
    ->addSubjectAlternativeNames('test3.domain.com')
    ->addDcv(new \Xolphin\Requests\RequestDCV('test1.domain.com', 'EMAIL', '[email protected]'))
    ->addDcv(new \Xolphin\Requests\RequestDCV('test2.domain.com', 'EMAIL', '[email protected]'));

$client->request()->send($request);

Reissue certificate

// Reissue a current certificate
$reissue = new \Xolphin\Requests\Reissue('<csr_string>', 'EMAIL');
$reissue->setApproverEmail('[email protected]');

$client->certificate()->reissue(<certificate_id>, $reissue);

Renew certificate

// Renew a current certificate
$currentCertificate = $client->certificate()->get(<certificate_id>);

$renew = new \Xolphin\Requests\Renew($currentCertificate->product, <years>, '<csr_string>', 'FILE');
$renew->setApproverEmail('[email protected]');

$client->certificate()->renew(<certificate_id>, $renew)

Create a note

$result = $client->request()->sendNote(1234,'My message');

Get list of notes

$notes =  $client->request()->getNotes(1234);
foreach($notes as $note){
    echo $note->messageBody . "\n";
}

Send a "Comodo Subscriber Agreement" email

//currently available languages: en, de, fr, nl
$client->request()->sendComodoSAEmail(1234, '[email protected]', 'en');

Request an "Encryption Everywhere" certificate

$request = $this->_client->request()->createEE();
$request->setCsr(<csr_string>);
$request->setApproverEmail('[email protected]');
$request->setApproverFirstName('FirstName');
$request->setApproverLastName('SecondName');
$request->setApproverPhone(+12345678901);
$request->setDcvType('FILE');
// if you just want to validate
$request->setValidate(true);

$response = $this->_client->request()->sendEE($request);

Certificate

Certificates list and expirations

$certificates = $client->certificate()->all();
foreach($certificates as $certificate) {
    echo $certificate->id . ' - ' . $certificate->isExpired() . "\n";
}

Download certificate

$certificates = $client->certificate()->all();
$cert = $client->certificate()->download($certificates[0]->id);
file_put_contents('cert.crt', $cert);

Support

List of products

$products = $client->support()->products();
foreach($products as $product) {
    echo $product->id . "\n";
}

Decode CSR

$csr = $client->support()->decodeCSR('<your csr string>');
echo $csr->type;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.