sigutil

package
v3.0.0-...-55e877b Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2023 License: GPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTimestampRequest

func NewTimestampRequest(body _e.Reader, opts *_a.RequestOptions) (*_a.Request, error)

NewTimestampRequest returns a new timestamp request based on the specified options.

Types

type CRLClient

type CRLClient struct {

	// HTTPClient is the HTTP client used to make CRL requests.
	// By default, an HTTP client with a 5 second timeout per request is used.
	HTTPClient *_ba.Client
}

CRLClient represents a CRL (Certificate revocation list) client. It is used to request revocation data from CRL servers.

func NewCRLClient

func NewCRLClient() *CRLClient

NewCRLClient returns a new CRL client.

func (*CRLClient) MakeRequest

func (_fde *CRLClient) MakeRequest(serverURL string, cert *_ee.Certificate) ([]byte, error)

MakeRequest makes a CRL request to the specified server and returns the response. If a server URL is not provided, it is extracted from the certificate.

type CertClient

type CertClient struct {

	// HTTPClient is the HTTP client used to make certificate requests.
	// By default, an HTTP client with a 5 second timeout per request is used.
	HTTPClient *_ba.Client
}

CertClient represents a X.509 certificate client. Its primary purpose is to download certificates.

func NewCertClient

func NewCertClient() *CertClient

NewCertClient returns a new certificate client.

func (*CertClient) Get

func (_ce *CertClient) Get(url string) (*_ee.Certificate, error)

Get retrieves the certificate at the specified URL.

func (*CertClient) GetIssuer

func (_gd *CertClient) GetIssuer(cert *_ee.Certificate) (*_ee.Certificate, error)

GetIssuer retrieves the issuer of the provided certificate.

func (*CertClient) IsCA

func (_eg *CertClient) IsCA(cert *_ee.Certificate) bool

IsCA returns true if the provided certificate appears to be a CA certificate.

type OCSPClient

type OCSPClient struct {

	// HTTPClient is the HTTP client used to make OCSP requests.
	// By default, an HTTP client with a 5 second timeout per request is used.
	HTTPClient *_ba.Client

	// Hash is the hash function  used when constructing the OCSP
	// requests. If zero, SHA-1 will be used.
	Hash _f.Hash
}

OCSPClient represents a OCSP (Online Certificate Status Protocol) client. It is used to request revocation data from OCSP servers.

func NewOCSPClient

func NewOCSPClient() *OCSPClient

NewOCSPClient returns a new OCSP client.

func (*OCSPClient) MakeRequest

func (_eec *OCSPClient) MakeRequest(serverURL string, cert, issuer *_ee.Certificate) (*_cg.Response, []byte, error)

MakeRequest makes a OCSP request to the specified server and returns the parsed and raw responses. If a server URL is not provided, it is extracted from the certificate.

type TimestampClient

type TimestampClient struct {

	// HTTPClient is the HTTP client used to make timestamp requests.
	// By default, an HTTP client with a 5 second timeout per request is used.
	HTTPClient *_ba.Client

	// Callbacks.
	BeforeHTTPRequest func(_ae *_ba.Request) error
}

TimestampClient represents a RFC 3161 timestamp client. It is used to obtain signed tokens from timestamp authority servers.

func NewTimestampClient

func NewTimestampClient() *TimestampClient

NewTimestampClient returns a new timestamp client.

func (*TimestampClient) GetEncodedToken

func (_ge *TimestampClient) GetEncodedToken(serverURL string, req *_a.Request) ([]byte, error)

GetEncodedToken executes the timestamp request and returns the DER encoded timestamp token bytes.

Jump to

Keyboard shortcuts

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