Skip to content


Repository files navigation

Certdog Dotnet Client

A .NET client for certdog allowing you to obtain certificates as .cer or PKCS#12/PFX from the certdog application

An official signed version of the dll can be obtained from here


  1. Build the project (or just download the dll)
  2. From your application, create a reference to certdognet.dll
  3. Write a few lines of code to obtain your certificates

More info on certdog:

More info on this client:

All the documentation:

Remember, certdog can interface to your own Microsoft CAs as well as Primekey EJBCA. Your code will be the same whether its Microsoft, an Internal CA or a PrimeKey EJBCA

Obtaining a certificate

// Add the reference to the client
using certdognet;
// If you want to add Subject Alternative Names, do it like this
// Otherwise you can pass null (or an empty List)    
List<String> sans = new List<String>();

// This will return the issued certificate data
GetCertResponse resp = Certdog.GetCert("", "Certdog TLS", "",
    "RSA2048", "somecomplexpassword", sans, "Test Team", "certdogtest", "password");

// Converting the P12 data binary and saving means you can import or use wherever you want
byte[] p12BinaryData = Convert.FromBase64String(resp.p12Data);
using (BinaryWriter binWriter = new BinaryWriter(File.Open(@"C:\temp\certdog.pfx", FileMode.Create)))

// Also save the PEM certificate
File.WriteAllText(@"C:\temp\certdog.cer", resp.pemCert);

Note: This is referencing the online certdog instance (at This is up between 08:00 and 22:00 UTC

Some other methods:

  • GetCertFromCsr
    • Accepts a pre-generated CSR data and returns a certificate
  • GetCertIssuers
    • Returns a list of the available issuers - including their certificates
  • GetCsrGenerators
    • Returns a list of the available CSR generators
  • RevokeCert
    • Revokes a previously issued certificate
  • GetCertDetails
    • Returns all the details associated with a stored certificate

The certdog username and password can be omitted for all methods - if you have stored these details in the Windows Credential Store. See here for more details