cert

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

package cert provides tools for use with cmd/9cert, used to create and use certificates for encryption and authentication.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertUser

func CertUser(c *x509.Certificate) string

func GenCA

func GenCA(cafile string) error

Generate a certificate authority and write it in PEM format to cafile

func GenCert

func GenCert(uname, certfile string, ca *x509.Certificate, caPrivkey *rsa.PrivateKey) error

GenCert generates a certificate for a user with name `uname` and writes it to `certfile`. This cert is signed by the certificate authority `ca` and its private key `caPrivkey`.

func LoadCA

func LoadCA(certf string) (ca *x509.Certificate, pk *rsa.PrivateKey, err error)

LoadCA loads a certificate and its private key out of certf

func LoadCert

func LoadCert(certf string) (cert *x509.Certificate, pk *rsa.PrivateKey, ca *x509.Certificate, err error)

LoadCert loads a certificate and its private key out of certf

func LoadTLSCert

func LoadTLSCert(certf string) (cert tls.Certificate, ca *x509.Certificate, err error)

LoadCert loads a certificate and its private key out of certf and returns them as a tls.Certificate

func TLSCertUser

func TLSCertUser(c *tls.Certificate) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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