tls

package
v2.24.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2019 License: GPL-3.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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, ca bool) (error, *rsa.PrivateKey, []byte)

func Generate

func Generate(cfg CertConfig, certPath string, keyPath string, ca bool) 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