certutil

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRSARootAndChildCerts added in v0.12.0

func NewRSARootAndChildCerts() (Pair, Pair, error)

NewRSARootAndChildCerts returns an RSA (2048-bit) root CA and a child certificate and their keys for "localhost" and "127.0.0.1".

func NewRootAndChildCerts

func NewRootAndChildCerts() (Pair, Pair, error)

NewRootAndChildCerts returns an ECDSA (P-384) root CA and a child certificate and their keys for "localhost" and "127.0.0.1".

Types

type Pair

type Pair struct {
	Cert []byte
	Key  []byte
}

Pair is a certificate and its private key in PEM format.

func GenerateChildCert

func GenerateChildCert(
	name string,
	ips []net.IP,
	priv crypto.PrivateKey,
	pub crypto.PublicKey,
	caPrivKey crypto.PrivateKey,
	caCert *x509.Certificate) (*tls.Certificate, Pair, error)

GenerateChildCert generates a x509 Certificate as a child of caCert and returns the following: - the certificate in PEM format as a byte slice - the private key in PEM format as a byte slice - the certificate and private key as a tls.Certificate

If any error occurs during the generation process, a non-nil error is returned.

func NewRSARootCA added in v0.12.0

func NewRSARootCA() (crypto.PrivateKey, *x509.Certificate, Pair, error)

NewRSARootCA generates a new x509 Certificate using RSA with a 2048-bit key and returns: - the private key - the certificate - the certificate and its key in PEM format as a byte slice.

If any error occurs during the generation process, a non-nil error is returned.

func NewRootCA

func NewRootCA() (crypto.PrivateKey, *x509.Certificate, Pair, error)

NewRootCA generates a new x509 Certificate using ECDSA P-384 and returns: - the private key - the certificate - the certificate and its key in PEM format as a byte slice.

If any error occurs during the generation process, a non-nil error is returned.

Directories

Path Synopsis
nolint:errorlint,forbidigo // it's a cli application
nolint:errorlint,forbidigo // it's a cli application

Jump to

Keyboard shortcuts

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