client

package
v2.2.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TimestampAuthorityClient

type TimestampAuthorityClient interface {
	GetTimestampResponse(tsq []byte) ([]byte, error)
}

TimestampAuthorityClient should be implemented by clients that want to request timestamp responses

type TimestampAuthorityClientImpl

type TimestampAuthorityClientImpl struct {
	TimestampAuthorityClient

	// URL is the path to the API to request timestamp responses
	URL string
	// CACert is the filepath to the PEM-encoded CA certificate for the connection to the TSA server
	CACert string
	// Cert is the filepath to the PEM-encoded certificate for the connection to the TSA server
	Cert string
	// Cert is the filepath to the PEM-encoded key corresponding to the certificate for the connection to the TSA server
	Key string
	// ServerName is the expected SAN value in the server's certificate - used for https://pkg.go.dev/crypto/tls#Config.ServerName
	ServerName string

	// Timeout is the request timeout
	Timeout time.Duration
}

TimestampAuthorityClient provides a client to query RFC 3161 timestamp authorities

func NewTSAClient

func NewTSAClient(url string) *TimestampAuthorityClientImpl

func NewTSAClientMTLS added in v2.2.0

func NewTSAClientMTLS(url, cacert, cert, key, serverName string) *TimestampAuthorityClientImpl

func (*TimestampAuthorityClientImpl) GetTimestampResponse

func (t *TimestampAuthorityClientImpl) GetTimestampResponse(tsq []byte) ([]byte, error)

GetTimestampResponse sends a timestamp query to a timestamp authority, returning a timestamp response. The query and response are defined by RFC 3161.

Jump to

Keyboard shortcuts

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