keys

package
v0.0.62 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: GPL-3.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

View Source
const CERTIFICATE = "CERTIFICATE"
View Source
const PRIVATE_KEY = "PRIVATE KEY"

Variables

This section is empty.

Functions

func NewClients added in v0.0.10

func NewClients() map[string]*Client

func NewKeypairReloader added in v0.0.57

func NewKeypairReloader(certPath, keyPath string) (*keypairReloader, error)

func PEMDecode added in v0.0.10

func PEMDecode(ContentBytes []byte) []byte

func PEMEncode added in v0.0.10

func PEMEncode(FileType string, ContentBytes []byte) ([]byte, error)

Types

type CA added in v0.0.10

type CA struct {
	PrivateKey       *rsa.PrivateKey
	Certificate      *x509.Certificate
	PrivateKeyPath   string
	CertificatePath  string
	CertificateBytes []byte
	PrivateKeyBytes  []byte
	Sni              int64
}

func NewCA added in v0.0.10

func NewCA() *CA

func (*CA) Generate added in v0.0.10

func (ca *CA) Generate() error

func (*CA) Read added in v0.0.10

func (ca *CA) Read(directory string) error

func (*CA) Write added in v0.0.10

func (ca *CA) Write(directory string) error

type Client added in v0.0.10

type Client struct {
	PrivateKey       *rsa.PrivateKey
	Certificate      *x509.Certificate
	PrivateKeyPath   string
	CertificatePath  string
	CertificateBytes []byte
	PrivateKeyBytes  []byte
	Sni              int64
}

func NewClient added in v0.0.10

func NewClient() *Client

func (*Client) Generate added in v0.0.10

func (client *Client) Generate(ca *CA, domains []string, ips []net.IP, CN string) error

func (*Client) Read added in v0.0.10

func (client *Client) Read(directory string, username string) error

func (*Client) Write added in v0.0.10

func (client *Client) Write(directory string, username string) error

type Keys

type Keys struct {
	CA       *CA
	Server   *Server
	Clients  map[string]*Client
	Reloader *keypairReloader
}

func NewKeys added in v0.0.10

func NewKeys() *Keys

func (*Keys) AppendClient added in v0.0.10

func (keys *Keys) AppendClient(username string, newClient *Client)

func (*Keys) ClientExists added in v0.0.14

func (keys *Keys) ClientExists(directory string, username string) error

func (*Keys) Exists added in v0.0.10

func (keys *Keys) Exists(directory string, username string) error

func (*Keys) Generate added in v0.0.10

func (keys *Keys) Generate(domains []string, ips []string) error

func (*Keys) GeneratePemBundle added in v0.0.10

func (keys *Keys) GeneratePemBundle(directory string, username string, client *Client) error

func (*Keys) LoadClients added in v0.0.10

func (keys *Keys) LoadClients(directory string) error

func (*Keys) RegenerateClient added in v0.0.57

func (keys *Keys) RegenerateClient(domains []string, ips []string) error

func (*Keys) RegenerateServer added in v0.0.57

func (keys *Keys) RegenerateServer(domains []string, ips []string) error

type Server added in v0.0.10

type Server struct {
	PrivateKey       *rsa.PrivateKey
	Certificate      *x509.Certificate
	PrivateKeyPath   string
	CertificatePath  string
	CertificateBytes []byte
	PrivateKeyBytes  []byte
	Sni              int64
}

func NewServer added in v0.0.10

func NewServer() *Server

func (*Server) Generate added in v0.0.10

func (server *Server) Generate(ca *CA, domains []string, ips []net.IP, CN string) error

func (*Server) Read added in v0.0.10

func (server *Server) Read(directory string) error

func (*Server) Write added in v0.0.10

func (server *Server) Write(directory string) error

Jump to

Keyboard shortcuts

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