package pki

import "github.com/plgd-dev/go-coap/v3/examples/dtls/pki"

Index

Functions

func GenerateCA

func GenerateCA() (ca *x509.Certificate, cert, key []byte, priv *ecdsa.PrivateKey, err error)

GenerateCA creates a deterministic certificate authority (for test purposes only)

func GenerateCertificate

func GenerateCertificate(ca *x509.Certificate, caPriv *ecdsa.PrivateKey, email string) (cert, key []byte, err error)

GenerateCertificate creates a certificate

func LoadCertPool

func LoadCertPool(caBytes []byte) (*x509.CertPool, error)

LoadCertPool loads cert pool from ca certificate

func LoadCertificate

func LoadCertificate(certBytes []byte) (*tls.Certificate, error)

LoadCertificate loads cert from bytes

func LoadKey

func LoadKey(keyBytes []byte) (crypto.PrivateKey, error)

LoadKey loads key from bytes

func LoadKeyAndCertificate

func LoadKeyAndCertificate(keyBytes []byte, certBytes []byte) (*tls.Certificate, error)

LoadKeyAndCertificate loads client certificate

Source Files

cert_gen.go cert_util.go

Directories

PathSynopsis
examples/dtls/pki/client
examples/dtls/pki/server
Version
v3.3.6 (latest)
Published
Sep 18, 2024
Platform
linux/amd64
Imports
16 packages
Last checked
1 week ago

Tools for package owners.