sectigo

package
v0.0.0-...-1b29a3a Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete[T any](ctx context.Context, c *Client, path string, payload interface{}) (*T, *http.Response, error)

Delete executes a DELETE-Request and deserializes the returned JSON information using the provided type.

func DeleteWithoutJSONResponse

func DeleteWithoutJSONResponse(ctx context.Context, c *Client, path string) (*http.Response, error)

DeleteWithoutJSONResponse executes a DELETE-Request without expecting a JSON response. Custom handling of the response can be done using the returned http.Response.

func Get

func Get[T any](ctx context.Context, c *Client, path string) (*T, *http.Response, error)

Get executes a GET-Requests and deserializes the returned JSON information using the provided type.

func GetWithoutJSONResponse

func GetWithoutJSONResponse(ctx context.Context, c *Client, path string) (*http.Response, error)

GetWithoutJSONResponse executes a GET-Request without expecting a JSON response. Custom handling of the response can be done using the returned http.Response.

func Post

func Post[T any](ctx context.Context, c *Client, path string, payload interface{}) (*T, *http.Response, error)

Post executes a POST-Requests and deserializes the returned JSON information using the provided type.

func PostWithoutJSONResponse

func PostWithoutJSONResponse(ctx context.Context, c *Client, path string, payload interface{}) (*http.Response, error)

PostWithoutJSONResponse executes a POST-Request without expecting a JSON response. Custom handling of the response can be done using the returned http.Response.

func PutWithoutJSONResponse

func PutWithoutJSONResponse(ctx context.Context, c *Client, path string, payload interface{}) (*http.Response, error)

DeleteWithoutJSONResponse executes a DELETE-Request without expecting a JSON response. Custom handling of the response can be done using the returned http.Response.

Types

type ACMEService

type ACMEService struct {
	Client *Client
}

ACMEService provides some methods handling sectigo ACME actions.

func (*ACMEService) AddDomains

AddDomains adds new domains to an existing acme account.

func (*ACMEService) CreateAccount

func (c *ACMEService) CreateAccount(request acme.CreateACMERequest) (*int, error)

CreateAccount creates a new ACME account

func (*ACMEService) DeleteAccount

func (c *ACMEService) DeleteAccount(id int) error

DeleteAccount deletes domains from an existing acme account.

func (*ACMEService) DeleteDomains

func (c *ACMEService) DeleteDomains(request acme.AddOrRemoveDomainsRequest, id int) (*acme.RemoveDomainsResponse, error)

DeleteDomains deletes domains from an existing acme account.

func (*ACMEService) Details

func (c *ACMEService) Details(id int) (*acme.ListACMEItem, error)

Details gets the information for a single acme accounts.

func (*ACMEService) List

func (c *ACMEService) List(request acme.ListRequest) (*[]acme.ListACMEItem, error)

List enumerates all acme accounts.

func (*ACMEService) ListServers

func (c *ACMEService) ListServers() (*[]acme.ListACMEServerItem, error)

ListServers enumerates all acme accounts.

type Client

type Client struct {

	// BaseURL for API requests.
	BaseURL string

	ClientService           *ClientService
	DomainService           *DomainService
	AcmeService             *ACMEService
	DomainValidationService *DomainValidationService
	SslService              *SSLService
	PersonService           *PersonService
	OrganizationService     *OrganizationService
	// contains filtered or unexported fields
}

Client is the main wrapper around the different sectigo services.

func NewClient

func NewClient(httpClient *http.Client, logger *zap.Logger, login, password, customerURI string) *Client

NewClient creates a new client against the sectigo API using the provided credentials and the http.Client.

type ClientService

type ClientService struct {
	Client *Client
}

ClientService provides some methods handling sectigo client certificate actions.

func (*ClientService) Collect

func (c *ClientService) Collect(orderNumber int, format string) (*string, error)

Collect downloads the certificate for the given ordernumber and format. Possible formats are:

- 'x509' for Certificate (w/ chain), PEM encoded - 'x509CO' for Certificate only, PEM encoded - 'base64' for PKCS#7, PEM encoded - 'bin' for PKCS#7 - 'x509IO' for Root/Intermediate(s) only, PEM encoded - 'x509IOR' for Intermediate(s)/Root only, PEM encoded - 'pem' for Certificate (w/ chain), PEM encoded - 'pemco' for Certificate only, PEM encoded - 'pemia' for Certificate (w/ issuer after), PEM encoded - 'pkcs12' for Certificate and Private key, PKCS#12

Depending on configuration at sectigo some options could be unavailable (e.g. pkcs12 requires access to the private key).

func (*ClientService) Enroll

Enroll submits an CSR to the server.

func (*ClientService) List

List enumerates all existing certificates.

func (*ClientService) ListByEmail

func (c *ClientService) ListByEmail(email string) (*[]client.ListItem, error)

ListByEmail enumerates all existing certificates owned by one user.

func (*ClientService) Profiles

func (c *ClientService) Profiles() (*[]client.ListProfileItem, error)

Profiles enumerates all client certificate profiles.

func (*ClientService) RevokeByEmail

func (c *ClientService) RevokeByEmail(req client.RevokeByEmailRequest) error

RevokeByEmail revokes all certificates associated with an email.

func (*ClientService) RevokeBySerial

func (c *ClientService) RevokeBySerial(req client.RevokeBySerialRequest) error

RevokeBySerial revokes the certificate with the matching serial.

type DomainService

type DomainService struct {
	Client *Client
}

DomainService provides some methods handling sectigo domain actions.

func (*DomainService) CreateDomain

func (c *DomainService) CreateDomain(request domain.CreateRequest) error

CreateDomain creates a new domain.

func (*DomainService) Infos

func (c *DomainService) Infos(id int) (*domain.Details, error)

Infos gets the details of a single domain.

func (*DomainService) List

func (c *DomainService) List() (*[]domain.ListItem, error)

List enumerates all existing domains.

type DomainValidationService

type DomainValidationService struct {
	Client *Client
}

DomainValidationService provides some methods handling sectigo domain validation actions.

func (*DomainValidationService) Clear

func (c *DomainValidationService) Clear(domain string) (*dcv.ClearResponse, error)

Clear resets the status of the DCV request.

func (*DomainValidationService) List

List enumerates all domain validation requests.

func (*DomainValidationService) StartCNAME

func (c *DomainValidationService) StartCNAME(domain string) (*dcv.StartCNAMEResponse, error)

StartCNAME starts the validation using the CNAME method.

func (*DomainValidationService) Status

func (c *DomainValidationService) Status(domain string) (*dcv.StatusResponse, error)

Status queries the status of a single domain.

func (*DomainValidationService) SubmitCNAME

func (c *DomainValidationService) SubmitCNAME(domain string) (*dcv.SubmitCNAMEResponse, error)

SubmitCNAME submits the completion of the validation using the CNAME method.

type ErrorResponse

type ErrorResponse struct {
	Response
	// human-readable message.
	Code        int    `json:"code,omitempty"`
	Description string `json:"description,omitempty"`
}

ErrorResponse provides the error information returned by sectigo.

func (*ErrorResponse) Error

func (r *ErrorResponse) Error() string

Error implements the error interface.

type OrganizationService

type OrganizationService struct {
	Client *Client
}

OrganizationService provides some methods handling sectigo organization actions.

type PersonService

type PersonService struct {
	Client *Client
}

PersonService provides some methods handling sectigo person actions.

func (*PersonService) CreatePerson

func (c *PersonService) CreatePerson(q person.CreateRequest) error

CreatePerson creates a new person using the provided information.

func (*PersonService) DeletePerson

func (c *PersonService) DeletePerson(id int) error

DeletePerson deletes a person using the provided id.

func (*PersonService) List

func (c *PersonService) List(q *person.ListParams) (*[]person.ListItem, error)

List enumerates all persons using the provided (optional) filters.

func (*PersonService) UpdatePerson

func (c *PersonService) UpdatePerson(id int, q person.UpdateRequest) error

UpdatePerson updates a person using the provided id and information.

type Response

type Response struct {
	// HTTP response.
	HTTPResponse *http.Response
}

Response is a wrapper around the normal http.Response.

type RevokeRequest

type RevokeRequest struct {
	Reason string `json:"reason"`
}

RevokeRequest represents the information on a certificate revocation.

type SSLService

type SSLService struct {
	Client *Client
}

SSLService provides some methods handling sectigo ssl certificate actions.

func (*SSLService) Collect

func (c *SSLService) Collect(sslID int, format string) (*string, error)

Collect downloads the certificate for the given sslId and format.

Possible formats are: 'x509' - for Certificate (w/ chain), PEM encoded, 'x509CO' - for Certificate only, PEM encoded, 'base64' - for PKCS#7, PEM encoded, 'bin' - for PKCS#7 'x509IO' - for Root/Intermediate(s) only, PEM encoded, 'x509IOR' - for Intermediate(s)/Root only, PEM encoded, 'pem' - for Certificate (w/ chain), PEM encoded, 'pemco' - for Certificate only, PEM encoded, 'pemia' - for Certificate (w/ issuer after), PEM encoded, 'x509' - for Certificate (w/ chain), PEM encoded, 'pkcs12' - for Certificate and Private key, PKCS#12

Depending on configuration at sectigo some options could be unavailable (e.g. pkcs12 requires access to the private key).

func (*SSLService) Details

func (c *SSLService) Details(id int) (*ssl.Details, error)

Details queries details on a single certificate using the (internal) sectigo ID.

func (*SSLService) Enroll

Enroll submits an CSR to the server.

func (*SSLService) List

func (c *SSLService) List(q *ssl.ListSSLRequest) (*[]ssl.ListItem, int, error)

List enumerates all ssl certificates.

func (*SSLService) Profiles

func (c *SSLService) Profiles() (*[]ssl.ListProfileItem, error)

Profiles enumerates all ssl certificate profiles.

func (*SSLService) Revoke

func (c *SSLService) Revoke(serial, reason string) error

Revoke revokes a single certificate by the serial and the reason.

func (*SSLService) RevokeBySslID

func (c *SSLService) RevokeBySslID(sslid, reason string) error

RevokeBySslID revokes a single certificate by the sslid and the reason.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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