Xolphin API module for Node.JS
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
lib
src
.gitignore
CHANGELOG.md
Cakefile
package.json
readme.md

readme.md

Xolphin API wrapper for Node.js

xolphin-api-js is a library which allows quick integration of the Xolphin REST API in Node.js 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 npm

npm install xolphin-api-js

And updated via

npm update xolphin-api-js

Usage

Client initialization

var xolphin = require('xolphin-api-js')

var client = new xolphin.Client('<username>', '<password>');

Requests

Getting list of requests

client.request.all(function(err, requests){
    requests.forEach(function(request){
        console.log(request.id, request._embedded.product.brand);
    });
});

Getting request by ID

client.request.get(961992625, function(err, request){
    console.log(err, request._embedded.product.id);
});

Request certificate

var ccr = client.request.create(24, 1, '<csr_string>', "EMAIL");
ccr.address = "Address";
ccr.approverFirstName = "FirstName";
ccr.approverLastName = "LastName";
ccr.approverPhone = "+12345678901";
ccr.approverEmail = "email@domain.com";
ccr.zipcode = "123456";
ccr.city = "City";
//currently available languages: en, de, fr, nl
ccr.language = "en";
ccr.company = "Company";
ccr.subjectAlternativeNames.push("test1.domain.com");
ccr.subjectAlternativeNames.push("test2.domain.com");
ccr.dcv.push({
    domain: "test1.domain.com",
    dcvType: "EMAIL",
    approverEmail: "email1.domain.com"
});

client.request.send(ccr, function(err, result) {
    console.log(err, result.id);
});

Create a note

client.request.sendNote(1234, 'My message',function(err, result){
    console.log('Errors: '+err);
    console.log('Message: '+result.message);
});

Get list of notes

client.request.getNotes(1234, function(err, result){
    result.forEach(function(note){
       console.log('Message: '+note.message);
    });
});

Send a "Comodo Subscriber Agreement" email

//currently available languages: en, de, fr, nl
client.request.sendComodoSAEmail(1234, 'mail@example.com', 'en', function(err, result){
    console.log('Errors: '+err);
    console.log('Message: '+result.message);
});

Request an "Encryption Everywhere" certificate

var request = client.request.createEE();
request.csr = "<csr_string>"
request.approverFirstName = "FirstName";
request.approverLastName = "LastName";
request.approverPhone = "+12345678901";
request.approverEmail = "email@domain.com";
request.validate = false;
request.subjectAlternativeNames.push("test1.domain.com");
request.subjectAlternativeNames.push("test2.domain.com");

client.request.sendEE(request,function(err, result){
    console.log(result);
});

Certificate

Certificates list and expirations

client.certificate.all(function(err, certificates){
    certificates.forEach(function(certificate){
        console.log(certificate.id, '-', (new Date(certificate.dateExpired).getTime() <= (new Date()).getTime()) );
    });
});

Download certificate

var fs = require('fs');
client.certificate.download(961983489, 'CRT', function(err, certificate){
    fs.writeFileSync('cert.crt', certificate);
});

Support

Products list

client.support.products(function(err, products){
    products.forEach(function(product){
        console.log(product.id, product.brand);
    });
});

Decode CSR

client.support.decodeCSR('<csr_string>', function(err, data){
    console.log(data.type, data.size);
});