create_ca

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2023 License: MIT Imports: 13 Imported by: 0

README

create-ca

使用go语言创建CA并基于此签发证书。

主要的内容创建一个根证书,并基于此根证书创建子证书,没有提供创建中间证书的功能。

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteCA

func WriteCA(cert *CERT, file string) error

Types

type CERT

type CERT struct {
	CERT       []byte
	CERTKEY    *ecdsa.PrivateKey
	CERTPEM    *bytes.Buffer
	CERTKEYPEM *bytes.Buffer
	CSR        *x509.Certificate
}

func CreateCA

func CreateCA(sub *pkix.Name, notBefore time.Time, expire int) (*CERT, error)

CreateCA 创建根证书

func CreateReq

func CreateReq(ca *CERT, sub *pkix.Name, notBefore time.Time, expire int, dns []string, ip []net.IP) (*CERT, error)

CreateReq 基于根证书创建证书

func ReadCA

func ReadCA(caCrt, caKey []byte) (*CERT, error)

ReadCA 读取一个证书

Jump to

Keyboard shortcuts

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