ssl

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package ssl represents our SiteHost `/ssl` API endpoint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSR

type CSR struct {
	Details CSRDetails `json:"csr_details"`
	Raw     string     `json:"csr"`
}

CSR represents both the parsed details and the raw PEM-encoded certificate signing request. The API wraps these inside the outer "return.csr" object, so the parsed and raw views are returned together.

type CSRDetails

type CSRDetails struct {
	CountryName            string `json:"countryName"`
	StateOrProvinceName    string `json:"stateOrProvinceName"`
	LocalityName           string `json:"localityName"`
	OrganizationName       string `json:"organizationName"`
	OrganizationalUnitName string `json:"organizationalUnitName"`
	CommonName             string `json:"commonName"`
	EmailAddress           string `json:"emailAddress"`
}

CSRDetails is the parsed subject information of a CSR.

type Certificate

type Certificate struct {
	CertID      string `json:"cert_id"`
	ClientID    string `json:"client_id"`
	CommonName  string `json:"common_name"`
	CSR         string `json:"csr"`
	Chain       string `json:"chain"`
	CRT         string `json:"crt"`
	IssueDate   string `json:"issue_date"`
	ExpiryDate  string `json:"expiry_date"`
	DateAdded   string `json:"date_added"`
	DateUpdated string `json:"date_updated"`
}

Certificate is the full record for a certificate. Chain and CRT are empty until the certificate is issued; CSR is the PEM-encoded certificate signing request that was generated when the cert was created.

type CertificateOptions

type CertificateOptions struct {
	CertID string `url:"cert_id"`
}

CertificateOptions identifies a certificate by ID. Used by GetCertificate and GetCSR.

type CertificateSummary

type CertificateSummary struct {
	CertID     string `json:"cert_id"`
	CommonName string `json:"common_name"`
	IssueDate  string `json:"issue_date"`
	ExpiryDate string `json:"expiry_date"`
}

CertificateSummary is the brief certificate entry returned by list_certificates. The full certificate is available via GetCertificate.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a Service to work with the SiteHost SSL API.

func New

func New(c *api.Client) *Client

New is an initialisation function.

func (*Client) GetCSR

func (s *Client) GetCSR(ctx context.Context, opt CertificateOptions) (response GetCSRResponse, err error)

GetCSR retrieves the certificate signing request (CSR) associated with a certificate via "ssl/get_csr.json". The response includes both the parsed subject details and the raw PEM-encoded CSR. The CertID field of opt is required.

func (*Client) GetCertificate

func (s *Client) GetCertificate(ctx context.Context, opt CertificateOptions) (response GetCertificateResponse, err error)

GetCertificate retrieves the full record for a single certificate (including the PEM-encoded CSR, chain, and CRT when issued) via "ssl/get_certificate.json". The CertID field of opt is required.

func (*Client) ListCertificates

func (s *Client) ListCertificates(ctx context.Context) (response ListCertificatesResponse, err error)

ListCertificates retrieves the list of certificates registered for the authenticated client via "ssl/list_certificates.json". Each entry is a brief summary; use GetCertificate for the full record.

type GetCSRResponse

type GetCSRResponse struct {
	Return struct {
		CSR CSR `json:"csr"`
	} `json:"return"`
	models.APIResponse
}

GetCSRResponse represents the response from get_csr.

type GetCertificateResponse

type GetCertificateResponse struct {
	Return Certificate `json:"return"`
	models.APIResponse
}

GetCertificateResponse represents the response from get_certificate.

type ListCertificatesResponse

type ListCertificatesResponse struct {
	Return []CertificateSummary `json:"return"`
	models.APIResponse
}

ListCertificatesResponse represents the response from list_certificates.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL