mock

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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TSAClient

type TSAClient struct {
	client.TimestampAuthorityClient

	Signer    crypto.Signer
	CertChain []*x509.Certificate
	Time      time.Time
	Message   []byte
}

TSAClient creates RFC3161 timestamps and implements client.TimestampAuthority. Messages to sign can either be provided in the initializer or through the request. Time can be provided in the initializer, or defaults to time.Now(). All other timestamp parameters are hardcoded.

func NewTSAClient

func NewTSAClient(o TSAClientOptions) (*TSAClient, error)

func (*TSAClient) GetTimestampResponse

func (c *TSAClient) GetTimestampResponse(tsq []byte) ([]byte, error)

type TSAClientOptions

type TSAClientOptions struct {
	// Time is an optional timestamp. Default is time.Now().
	Time time.Time
	// Message is the pre-hashed message to sign over, typically a raw signature.
	Message []byte
	// Signer is an optional signer created out of band. Client creates one if not set.
	Signer crypto.Signer
}

TSAClientOptions provide customization for the mock TSA client.

Jump to

Keyboard shortcuts

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