tls

package
v2.21.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2019 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package tls contains code for TLS certificate generation and signing.

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultLegitConfig = CertConfig{
		Bits:               4096,
		Country:            "US",
		Locality:           "",
		Organization:       "bettercap devteam",
		OrganizationalUnit: "https://bettercap.org/",
		CommonName:         "bettercap",
	}
	DefaultSpoofConfig = CertConfig{
		Bits:               4096,
		Country:            "US",
		Locality:           "Scottsdale",
		Organization:       "GoDaddy.com, Inc.",
		OrganizationalUnit: "https://certs.godaddy.com/repository/",
		CommonName:         "Go Daddy Secure Certificate Authority - G2",
	}
)

Functions

func CertConfigToModule

func CertConfigToModule(prefix string, m *session.SessionModule, defaults CertConfig)

func CreateCertificate

func CreateCertificate(cfg CertConfig) (error, *rsa.PrivateKey, []byte)

func Generate

func Generate(cfg CertConfig, certPath string, keyPath string) error

func SignCertificateForHost

func SignCertificateForHost(ca *tls.Certificate, host string, port int) (cert *tls.Certificate, err error)

Types

type CertConfig

type CertConfig struct {
	Bits               int
	Country            string
	Locality           string
	Organization       string
	OrganizationalUnit string
	CommonName         string
}

func CertConfigFromModule

func CertConfigFromModule(prefix string, m session.SessionModule) (err error, cfg CertConfig)

Jump to

Keyboard shortcuts

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