View Source Dnsimple.Certificates (dnsimple v4.0.0)

Provides functions to interact with the SSL certificate endpoints.

Summary

Functions

Link to this function

download_certificate(client, account_id, domain_id, certificate_id, options \\ [])

View Source
@spec download_certificate(
  Dnsimple.Client.t(),
  String.t() | integer(),
  String.t() | integer(),
  integer(),
  Keyword.t()
) :: {:ok | :error, Dnsimple.Response.t()}

Get the PEM-encoded certificate, along with the root certificate and intermediate chain.

See:

Examples

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Certificates.download_certificate(client, account_id = "1010", domain_id = "example.com")
Link to this function

get_certificate(client, account_id, domain_id, certificate_id, options \\ [])

View Source
@spec get_certificate(
  Dnsimple.Client.t(),
  String.t() | integer(),
  String.t() | integer(),
  integer(),
  Keyword.t()
) :: {:ok | :error, Dnsimple.Response.t()}

Get the details of a certificate.

See:

Examples

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Certificates.get_certificate(client, account_id = "1010", domain_id = "example.com")
Link to this function

get_certificate_private_key(client, account_id, domain_id, certificate_id, options \\ [])

View Source
@spec get_certificate_private_key(
  Dnsimple.Client.t(),
  String.t() | integer(),
  String.t() | integer(),
  integer(),
  Keyword.t()
) :: {:ok | :error, Dnsimple.Response.t()}

Get the PEM-encoded certificate private key.

See:

Examples

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Certificates.get_certificate_private_key(client, account_id = "1010", domain_id = "example.com")
Link to this function

issue_letsencrypt_certificate(client, account_id, domain_id, certificate_id, options \\ [])

View Source
@spec issue_letsencrypt_certificate(
  Dnsimple.Client.t(),
  String.t() | integer(),
  String.t() | integer(),
  integer(),
  Keyword.t()
) :: {:ok | :error, Dnsimple.Response.t()}

Issue a pending Let's Encrypt certificate order.

Note that the issuance process is async. A successful response means the issuance request has been successfully acknowledged and queued for processing.

See:

Examples

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Certificates.issue_letsencrypt_certificate(client, account_id = "1010", domain_id = "example.com", purchase_id = 100)
Link to this function

issue_letsencrypt_certificate_renewal(client, account_id, domain_id, certificate_id, certificate_renewal_id, options \\ [])

View Source
@spec issue_letsencrypt_certificate_renewal(
  Dnsimple.Client.t(),
  String.t() | integer(),
  String.t() | integer(),
  integer(),
  integer(),
  Keyword.t()
) :: {:ok | :error, Dnsimple.Response.t()}

Issue a pending Let's Encrypt certificate renewal order.

Note that the issuance process is async. A successful response means the issuance request has been successfully acknowledged and queued for processing.

See:

Examples

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Certificates.issue_letsencrypt_certificate(client, account_id = "1010", domain_id = "example.com", certificate_id = 100, renewal_id: 200)
Link to this function

list_certificates(client, account_id, domain_id, options \\ [])

View Source
@spec list_certificates(
  Dnsimple.Client.t(),
  String.t() | integer(),
  String.t() | integer(),
  Keyword.t()
) :: {:ok | :error, Dnsimple.Response.t()}

List certificates for a domain in the account.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Certificates.list_certificates(client, account_id = "1010", domain_id = "example.com")
{:ok, response} = Dnsimple.Certificates.list_certificates(client, account_id = "1010", domain_id = "example.com", page: 2, per_page: 10)
{:ok, response} = Dnsimple.Certificates.list_certificates(client, account_id = "1010", domain_id = "example.com", sort: "expiration:desc")
Link to this function

purchase_letsencrypt_certificate(client, account_id, domain_id, attributes \\ %{}, options \\ [])

View Source
@spec purchase_letsencrypt_certificate(
  Dnsimple.Client.t(),
  String.t() | integer(),
  String.t() | integer(),
  Keyword.t(),
  Keyword.t()
) :: {:ok | :error, Dnsimple.Response.t()}

Purchase a Let's Encrypt certificate.

This method creates a new purchase order. The order ID should be used to request the issuance of the certificate using #issue_letsencrypt_certificate.

See:

Examples

# Purchase a certificate for a single name
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Certificates.purchase_letsencrypt_certificate(client, account_id = "1010", domain_id = "example.com", name: "www")
purchase_id     = response.data.id

# Purchase a certificate for multiple names (SAN)
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Certificates.purchase_letsencrypt_certificate(client, account_id = "1010", domain_id = "example.com", alternate_names: ["example.com", "www.example.com", "status.example.com"])

# Enable auto-renew on purchase
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Certificates.purchase_letsencrypt_certificate(client, account_id = "1010", domain_id = "example.com", auto_renew: true)

# Signature Algorithm
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Certificates.purchase_letsencrypt_certificate(client, account_id = "1010", domain_id = "example.com", signature_algorithm: "RSA")
Link to this function

purchase_letsencrypt_certificate_renewal(client, account_id, domain_id, certificate_id, attributes \\ %{}, options \\ [])

View Source
@spec purchase_letsencrypt_certificate_renewal(
  Dnsimple.Client.t(),
  String.t() | integer(),
  String.t() | integer(),
  integer(),
  Keyword.t(),
  Keyword.t()
) :: {:ok | :error, Dnsimple.Response.t()}

Purchase a Let's Encrypt certificate renewal.

This method creates a new renewal order. The order ID should be used to request the issuance of the certificate using #issue_letsencrypt_certificate_renewal.

See:

Examples

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Certificates.purchase_letsencrypt_certificate_renewal(client, account_id = "1010", domain_id = "example.com", certificate_id = 100)
renewal_id      = response.data.id

# Enable auto-renew on purchase
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Certificates.purchase_letsencrypt_certificate_renewal(client, account_id = "1010", domain_id = "example.com", certificate_id = 100, auto_renew: true)

# Signature Algorithm
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Certificates.purchase_letsencrypt_certificate_renewal(client, account_id = "1010", domain_id = "example.com", certificate_id = 100, signature_algorithm: "RSA")