keys

package
v0.0.92 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2025 License: GPL-3.0 Imports: 22 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       *ecdsa.PrivateKey `json:"-"`
	Certificate      *x509.Certificate `json:"-"`
	PrivateKeyPath   string            `json:"-"`
	CertificatePath  string            `json:"-"`
	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       *ecdsa.PrivateKey `json:"-"`
	Certificate      *x509.Certificate `json:"-"`
	PrivateKeyPath   string            `json:"-"`
	CertificatePath  string            `json:"-"`
	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 *configuration.Domains, ips *configuration.IPs, 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 Encrypted added in v0.0.73

type Encrypted struct {
	Keys string
}

type Keys

type Keys struct {
	CA       *CA
	Server   *Server
	Clients  map[string]*Client
	Reloader *keypairReloader `json:"-"`
}

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) CAExists added in v0.0.63

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

func (*Keys) ClientExists added in v0.0.14

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

func (*Keys) GenerateCA added in v0.0.64

func (keys *Keys) GenerateCA() error

func (*Keys) GenerateClient added in v0.0.64

func (keys *Keys) GenerateClient(domains *configuration.Domains, ips *configuration.IPs, username string) error

func (*Keys) GeneratePemBundle added in v0.0.10

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

func (*Keys) GenerateServer added in v0.0.64

func (keys *Keys) GenerateServer(domains *configuration.Domains, ips *configuration.IPs) error

func (*Keys) LoadClients added in v0.0.10

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

func (*Keys) ServerExists added in v0.0.63

func (keys *Keys) ServerExists(directory string, agent string) error

type Server added in v0.0.10

type Server struct {
	PrivateKey       *ecdsa.PrivateKey `json:"-"`
	Certificate      *x509.Certificate `json:"-"`
	PrivateKeyPath   string            `json:"-"`
	CertificatePath  string            `json:"-"`
	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 *configuration.Domains, ips *configuration.IPs, CN string) error

func (*Server) Read added in v0.0.10

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

func (*Server) Write added in v0.0.10

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

Jump to

Keyboard shortcuts

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