client

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodePKCS7CertsOnly

func DecodePKCS7CertsOnly(b []byte) ([]*x509.Certificate, error)

func ProcessAllParts

func ProcessAllParts(mpr *multipart.Reader) ([]*x509.Certificate, []byte, error)

func ReadAllBase64Response

func ReadAllBase64Response(r io.Reader) ([]byte, error)

func ReadCertResponse

func ReadCertResponse(r io.Reader) ([]*x509.Certificate, error)

Types

type BaseClient

type BaseClient interface {
	NewRequest(method string, endpoint string, serverAddr string, aps string, contentType, transferEncoding string, accepts string, body io.Reader) (*http.Request, error)
	Do(req *http.Request) (*http.Response, []byte, error)
}

func NewBaseClient

func NewBaseClient(url *url.URL, httpClient *http.Client) BaseClient

type ClientConfig

type ClientConfig struct {
	BaseURL *url.URL
	// contains filtered or unexported fields
}

func (*ClientConfig) Do

func (c *ClientConfig) Do(req *http.Request) (*http.Response, []byte, error)

func (*ClientConfig) NewRequest

func (c *ClientConfig) NewRequest(method string, endpoint string, serverAddr string, aps string, contentType, transferEncoding string, accepts string, body io.Reader) (*http.Request, error)

func (*ClientConfig) Uri

func (c *ClientConfig) Uri(endpoint string, serverAddr string, aps string) string

type LamassuEstClient

type LamassuEstClient interface {
	CACerts(ctx context.Context) ([]*x509.Certificate, error)
	Enroll(ctx context.Context, aps string, csr *x509.CertificateRequest) (*x509.Certificate, error)
	Reenroll(ctx context.Context, csr *x509.CertificateRequest) (*x509.Certificate, error)
	ServerKeyGen(ctx context.Context, aps string, csr *x509.CertificateRequest) (*x509.Certificate, []byte, error)
}

func NewLamassuEstClient

func NewLamassuEstClient(estServerAddress string, serverCertPool *x509.CertPool, clientCert *x509.Certificate, clientKey []byte, logger log.Logger) (LamassuEstClient, error)

type LamassuEstClientConfig

type LamassuEstClientConfig struct {
	Client                 BaseClient
	EstServerAddress       string
	EstServerCaCertificate *x509.CertPool
	EstClientCertificate   *x509.Certificate
	EstClientKey           interface{}
	// contains filtered or unexported fields
}

func (*LamassuEstClientConfig) CACerts

func (*LamassuEstClientConfig) Enroll

func (*LamassuEstClientConfig) Reenroll

func (*LamassuEstClientConfig) ServerKeyGen

Jump to

Keyboard shortcuts

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