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.
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 can be installed via npm
npm install xolphin-api-js
And updated via
npm update xolphin-api-js
var xolphin = require('xolphin-api-js')
var client = new xolphin.Client('<username>', '<password>');
client.request.all(function(err, requests){
requests.forEach(function(request){
console.log(request.id, request._embedded.product.brand);
});
});
client.request.get(961992625, function(err, request){
console.log(err, request._embedded.product.id);
});
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);
});
client.request.sendNote(1234, 'My message',function(err, result){
console.log('Errors: '+err);
console.log('Message: '+result.message);
});
client.request.getNotes(1234, function(err, result){
result.forEach(function(note){
console.log('Message: '+note.message);
});
});
//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);
});
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);
});
client.certificate.all(function(err, certificates){
certificates.forEach(function(certificate){
console.log(certificate.id, '-', (new Date(certificate.dateExpired).getTime() <= (new Date()).getTime()) );
});
});
var fs = require('fs');
client.certificate.download(961983489, 'CRT', function(err, certificate){
fs.writeFileSync('cert.crt', certificate);
});
client.support.products(function(err, products){
products.forEach(function(product){
console.log(product.id, product.brand);
});
});
client.support.decodeCSR('<csr_string>', function(err, data){
console.log(data.type, data.size);
});