certs

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package certs creates self-signed certificates and checks certificate files.

Index

Constants

View Source
const Validity = 825 * 24 * time.Hour

Validity of self-signed certificates. 825 days is the longest that macOS and iOS accept.

Variables

This section is empty.

Functions

func CheckPair

func CheckPair(certPEM, keyPEM []byte) (*x509.Certificate, error)

CheckPair parses a certificate and its private key and checks that they match. It returns the first certificate of the chain.

func Names

func Names(serverName string) (dns []string, ips []net.IP)

Names returns the DNS names and IP addresses a self-signed certificate covers for serverName.

func Reusable

func Reusable(certPEM, keyPEM []byte, serverName string, now time.Time) bool

Reusable reports whether an existing self-signed certificate can be kept: the pair is valid, it covers serverName and it does not expire within 30 days.

func SelfSigned

func SelfSigned(serverName string, now time.Time) (certPEM, keyPEM []byte, err error)

SelfSigned returns a new self-signed certificate and its private key, both PEM encoded.

Types

This section is empty.

Jump to

Keyboard shortcuts

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