acmeapi: git.devever.net/hlandau/acmeapi/acmeutils Index | Files

package acmeutils

import "git.devever.net/hlandau/acmeapi/acmeutils"

Package acmeutils provides miscellaneous ACME-related utility functions.

Index

Package Files

hostname.go keyauth.go load.go

func Base64Thumbprint Uses

func Base64Thumbprint(key interface{}) (string, error)

Calculates the base64 thumbprint of a public or private key. Returns an error if the key is of an unknown type.

func CreateTLSSNICertificate Uses

func CreateTLSSNICertificate(hostname string) (certDER []byte, privateKey crypto.PrivateKey, err error)

Creates a self-signed certificate and matching private key suitable for responding to a TLS-SNI challenge. hostname should be a hostname returned by TLSSNIHostname.

func DNSKeyAuthorization Uses

func DNSKeyAuthorization(accountKey interface{}, token string) (string, error)

Calculates a key authorization which is then hashed and base64 encoded as is required for the DNS challenge.

func KeyAuthorization Uses

func KeyAuthorization(accountKey interface{}, token string) (string, error)

Calculates a key authorization using the given account public or private key and the token to prefix.

func LoadCSR Uses

func LoadCSR(pemBlock []byte) ([]byte, error)

Load a PEM CSR from a stream and return it in DER form.

func LoadCertificates Uses

func LoadCertificates(pemBlock []byte) ([][]byte, error)

Load one or more certificates from a sequence of PEM-encoded certificates.

func LoadPrivateKey Uses

func LoadPrivateKey(keyPEMBlock []byte) (crypto.PrivateKey, error)

Load a PEM private key from a stream.

func LoadPrivateKeyDER Uses

func LoadPrivateKeyDER(der []byte) (crypto.PrivateKey, error)

Parse a DER private key. The key can be RSA or ECDSA. PKCS8 containers are supported.

func NormalizeHostname Uses

func NormalizeHostname(name string) (string, error)

Normalizes the hostname given. If the hostname is not valid, returns "" and an error.

func SaveCertificates Uses

func SaveCertificates(w io.Writer, certificates ...[]byte) error

Writes one or more DER-formatted certificates in PEM format.

func SavePrivateKey Uses

func SavePrivateKey(w io.Writer, pk crypto.PrivateKey) error

Write a private key in PEM form.

func TLSSNIHostname Uses

func TLSSNIHostname(accountKey interface{}, token string) (string, error)

Determines the hostname which must appear in a TLS-SNI challenge certificate.

func ValidateHostname Uses

func ValidateHostname(name string) bool

Returns true iff the given string is a valid hostname.

Package acmeutils imports 19 packages (graph) and is imported by 1 packages. Updated 2018-08-15. Refresh now. Tools for package owners.