package ocsp
import "go.mongodb.org/mongo-driver/x/mongo/driver/ocsp"
Index ¶
- func Verify(ctx context.Context, connState tls.ConnectionState, opts *VerifyOptions) error
- type Cache
- type ConcurrentCache
- func NewCache() *ConcurrentCache
- func (c *ConcurrentCache) Get(request *ocsp.Request) *ResponseDetails
- func (c *ConcurrentCache) Update(request *ocsp.Request, response *ResponseDetails) *ResponseDetails
- type Error
- type ResponseDetails
- type VerifyOptions
Functions ¶
func Verify ¶
func Verify(ctx context.Context, connState tls.ConnectionState, opts *VerifyOptions) error
Verify performs OCSP verification for the provided ConnectionState instance.
Types ¶
type Cache ¶
type Cache interface { Update(*ocsp.Request, *ResponseDetails) *ResponseDetails Get(request *ocsp.Request) *ResponseDetails }
Cache represents an OCSP cache.
type ConcurrentCache ¶
ConcurrentCache is an implementation of ocsp.Cache that's safe for concurrent use.
func NewCache ¶
func NewCache() *ConcurrentCache
NewCache creates an empty OCSP cache.
func (*ConcurrentCache) Get ¶
func (c *ConcurrentCache) Get(request *ocsp.Request) *ResponseDetails
Get returns the cached response for the request, or nil if there is no cached response. If the cached response has expired, it will be removed from the cache and nil will be returned.
func (*ConcurrentCache) Update ¶
func (c *ConcurrentCache) Update(request *ocsp.Request, response *ResponseDetails) *ResponseDetails
Update updates the cache entry for the provided request. The provided response will only be cached if it has a status that is not ocsp.Unknown and has a non-zero NextUpdate time. If there is an existing cache entry for request, it will be overwritten by response if response.NextUpdate is further ahead in the future than the existing entry's NextUpdate.
This function returns the most up-to-date response corresponding to the request.
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error represents an OCSP verification error
func (*Error) Error ¶
Error implements the error interface
func (*Error) Unwrap ¶
Unwrap returns the underlying error.
type ResponseDetails ¶
ResponseDetails contains a subset of the details needed from an OCSP response after the original response has been validated.
type VerifyOptions ¶
VerifyOptions specifies options to configure OCSP verification.
Source Files ¶
cache.go config.go ocsp.go options.go
- Version
- v1.13.0-prerelease
- Published
- Jun 22, 2023
- Platform
- linux/amd64
- Imports
- 17 packages
- Last checked
- 16 minutes ago –
Tools for package owners.