tls

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseFiles

func ParseFiles(ca, cert, key string) (*ParsedCertData, *RawCertData, error)

ParseFiles parses the given TLS-related files.

Types

type ParsedCertData

type ParsedCertData struct {
	// contains filtered or unexported fields
}

ParsedCertData contains a parsed CA and TLS certificate.

func (*ParsedCertData) ClientConfig

func (c *ParsedCertData) ClientConfig(sni string) *tls.Config

ClientConfig return a TLS configuration for a client.

func (*ParsedCertData) DNSNames

func (c *ParsedCertData) DNSNames() []string

DNSNames returns the certificate DNS names.

func (*ParsedCertData) ServerConfig

func (c *ParsedCertData) ServerConfig() *tls.Config

ServerConfig return a TLS configuration for a server.

type RawCertData added in v0.3.0

type RawCertData struct {
	// contains filtered or unexported fields
}

RawCertData contains a raw TLS certificate, private key, and CA.

func (*RawCertData) CA added in v0.3.0

func (c *RawCertData) CA() []byte

func (*RawCertData) Certificate added in v0.3.0

func (c *RawCertData) Certificate() []byte

func (*RawCertData) Key added in v0.3.0

func (c *RawCertData) Key() []byte

Jump to

Keyboard shortcuts

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