mad

package module
v0.0.0-...-458ec53 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 13 Imported by: 0

README

mad

Generate root CA and derivative certificate for any domains and any IPs

❤️ A project by txthinking.com

Install via Nami
nami install mad
Usage
NAME:
   Mad - Generate root CA and derivative certificate for any domains and any IPs

USAGE:
   mad [global options] command [command options] [arguments...]

VERSION:
   20210401

AUTHOR:
   Cloud <cloud@txthinking.com>

COMMANDS:
   ca       Generate CA
   cert     Generate certificate
   install  Install ROOT CA
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h     show help (default: false)
   --version, -v  print the version (default: false)
Example

Generate root CA

mad ca --ca ./ca.pem --key ./ca_key.pem

Generate cert for localhost

mad cert --ca ./ca.pem --ca_key ./ca_key.pem --cert ./localhost_cert.pem --key ./localhost_cert_key.pem --domain localhost

License

Licensed under The MIT License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Install

func Install(ca string) error

Types

type Ca

type Ca struct {
	C      *x509.Certificate
	CaPEM  []byte
	KeyPEM []byte
}

func NewCa

func NewCa(Organization, OrganizationalUnit, CommonName string) *Ca

func (*Ca) Ca

func (c *Ca) Ca() []byte

func (*Ca) Create

func (c *Ca) Create() error

func (*Ca) Key

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

func (*Ca) SaveToFile

func (c *Ca) SaveToFile(ca, key string) error

type Cert

type Cert struct {
	CaPEM    []byte
	CaKeyPEM []byte
	C        *x509.Certificate
	CertPEM  []byte
	KeyPEM   []byte
}

func NewCert

func NewCert(caPEM, caKeyPEM []byte, Organization, OrganizationalUnit string) *Cert

func (*Cert) Cert

func (c *Cert) Cert() []byte

func (*Cert) Create

func (c *Cert) Create() error

func (*Cert) Key

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

func (*Cert) SaveToFile

func (c *Cert) SaveToFile(cert, key string) error

func (*Cert) SetDNSNames

func (c *Cert) SetDNSNames(domains []string)

func (*Cert) SetIPAddresses

func (c *Cert) SetIPAddresses(ips []net.IP)

Directories

Path Synopsis
cli
mad

Jump to

Keyboard shortcuts

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