XolphinApiDotNet is a client library targeting .NET 4.5 and above that provides an easy way to interact with the Xolphin REST API.
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.
There are 2 ways to use XolphinApiDotNet:
- Install-package XolphinApiDotNet (via Nuget)
- Download source and compile
var client = new Client("<username>", "<password>");
var client = new Client("[email protected]", "Sup3rSecre7P@s$w0rdForThe@p1");
client.TestMode(true);
Most of the Requests classes have ability to assign the additional parameters of the request with 2 ways:
var reissue = new XolphinApiDotNet.Requests.Reissue(<csr_string>, DCVType.Email);
// 1. Fluent style
reissue.SetApproverEmail("[email protected]");
// 2. Property assignment
reissue.ApproverEmail = "[email protected]";
// GET /requests
var requests = client.Request.All();
foreach (var request in requests)
{
Console.WriteLine(request.Id);
}
// POST /requests
var products = client.Support.Products();
if (products.Any())
{
var productId = products.First().Id;
// request certificate for 1 year
var requestsRequest = new XolphinApiDotNet.Requests.Request(productId, 1, <csr_string>, DCVType.Email)
.SetApproverFirstName("<first_name>")
.SetApproverLastName("<last_name>")
.SetApproverPhone("+12345678901")
.SetZipcode("123456")
.SetСity("<city>")
.SetCompany("<company>")
.SetApproverEmail("<email>")
//currently available languages: en, de, fr, nl
.SetLanguage("en")
.AddSubjectAlternativeName("test1.domain.com")
.AddSubjectAlternativeName("test2.domain.com")
.AddSubjectAlternativeName("test3.domain.com")
.AddDcv(new RequestDCV("test1.domain.com", DCVType.Email, "[email protected]"))
.AddDcv(new RequestDCV("test2.domain.com", DCVType.Email, "[email protected]"));
var responsesRequest = client.Request.Send(requestsRequest);
Console.WriteLine(responsesRequest.Id);
}
// GET /requests/{id}
var responseRequest = client.Request.Get(1234);
Console.WriteLine(responseRequest.Id);
// POST /requests/{id}/upload-document
var uploadResponse = client.Request.Upload(1234, new UploadDocument("<file_name>", File.ReadAllBytes("document.pdf")).SetDescription("<description>"));
Console.WriteLine(uploadResponse.Message);
// POST /requests/{id}/retry-dcv
var retryDcvResponse = client.Request.RetryDCV(1234, new DCV("test.domain.com", DCVType.Email, "[email protected]"));
Console.WriteLine(retryDcvResponse.Message);
// POST /requests/{id}/sa
var comodoSA = new XolphinApiDotNet.Requests.ComodoSA("[email protected]");
//currently available languages: en, de, fr, nl
comodoSA.SetLanguage("en");
var subscribe = client.Request.SubscribeComodoSA(1234, comodoSA);
Console.WriteLine(subscribe.Message);
// POST /requests/{id}/schedule-validation-call
var scheduleValidationCallResponse = client.Request.ScheduleValidationCall(1234, DateTime.Now);
Console.WriteLine(scheduleValidationCallResponse.Message);
// POST /requests/{id}/notes
var result = client.Request.SendNote(1234, new NoteSend("my message"));
Console.WriteLine(result.SendNote);
// GET /requests/{id}/notes
var result = client.Request.GetNotes(1234);
foreach (Responses.Note note in result.Notes)
{
Console.WriteLine(note.Message);
}
// GET /certificates
var certificates = client.Certificate.All();
foreach (var certificate in certificates)
{
Console.WriteLine(certificate.Id);
}
// GET /certificates/{id}
var certificate = client.Certificate.Get(1234);
Console.WriteLine(certificate.Id);
// GET /certificates/{id}/download
var downloadResult = client.Certificate.Download(1234);
// POST /certificates/{id}/reissue
var reissue = new XolphinApiDotNet.Requests.Reissue(<csr_string>, DCVType.Email);
var responsesRequest = client.Certificate.Reissue(1234, reissue);
Console.WriteLine(responsesReissue.Id);
// POST /certificates/{id}/renew
var products = client.Support.Products();
var productId = products.First().Id;
// renew certificate for 1 year
var renew = new XolphinApiDotNet.Requests.Renew(productId, 1, <csr_string>, DCVType.Email);
var responsesRequest = client.Certificate.Renew(1234, renew);
Console.WriteLine(responsesRequest.Id);
// POST /certificates/{id}/cancel
var cancelSettings = new XolphinApiDotNet.Requests.CancelSettings("cancellation reason");
var responsesBase = client.Certificate.Cancel(1234, cancelSettings);
// GET /approver-email-addresses
var emailAddresses = client.Support.ApproverEmailAddresses("domain.com");
foreach (var emailAddress in emailAddresses)
{
Console.WriteLine(emailAddress);
}
// POST /decode-csr
var csr = client.Support.DecodeCSR(<csr_string>);
Console.WriteLine(csr.Type);
// GET /products
var products = client.Support.Products();
foreach (var product in products)
{
Console.WriteLine(product.Id);
}
// GET /products/{id}
var product = client.Support.Product(1234);
Console.WriteLine(product.Name);