client

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: Apache-2.0 Imports: 15 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Creates a CSR from a new key and sends it to the CA. Can use a token with Prefix "Bearer " for authentication. Expects authentication via proxy if token is nil.
	NewCertAndKey(subj pkix.Name, hostnames []string, expiration time.Duration, token *string) (privateKey *rsa.PrivateKey, cert *x509.Certificate, errCode int, err error)

	// Creates a CSR from an existing key and sends it to the CA. Can use a token with Prefix "Bearer " for authentication. Expects authentication via proxy if token is nil.
	NewCertFromKey(privateKey *rsa.PrivateKey, subj pkix.Name, hostnames []string, expiration time.Duration, token *string) (cert *x509.Certificate, errCode int, err error)

	// Revokes the given cert at the CA. Can use a token with Prefix "Bearer " for authentication. Expects authentication via proxy if token is nil.
	Revoke(cert *x509.Certificate, reason string, token *string) (errCode int, err error)

	// Checks if the certificate is expired. If not, queries the status of the given Certifiacte at the CA using OCSP. Can use a token with Prefix "Bearer " for authentication. Expects authentication via proxy if token is nil.
	GetStatus(cert *x509.Certificate, token *string) (expired bool, ocsp *ocsp.Response, errCode int, err error)

	// Gets the public CA certificate. Can use a token with Prefix "Bearer " for authentication. Expects authentication via proxy if token is nil.
	GetCA(token *string) (cert *x509.Certificate, errCode int, err error)
}

func NewClient

func NewClient(baseUrl string) (client Client)

type RealClient

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

func (*RealClient) GetCA

func (c *RealClient) GetCA(token *string) (cert *x509.Certificate, errCode int, err error)

func (*RealClient) GetStatus

func (c *RealClient) GetStatus(cert *x509.Certificate, token *string) (expired bool, resp *ocsp.Response, code int, err error)

func (*RealClient) NewCertAndKey

func (c *RealClient) NewCertAndKey(subj pkix.Name, hostnames []string, expiration time.Duration, token *string) (privateKey *rsa.PrivateKey, cert *x509.Certificate, errCode int, err error)

func (*RealClient) NewCertFromKey

func (c *RealClient) NewCertFromKey(privateKey *rsa.PrivateKey, subj pkix.Name, hostnames []string, expiration time.Duration, token *string) (cert *x509.Certificate, errCode int, err error)

func (*RealClient) Revoke

func (c *RealClient) Revoke(cert *x509.Certificate, reason string, token *string) (errCode int, err error)

Jump to

Keyboard shortcuts

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