Documentation
¶
Overview ¶
Package derivecert is used to deterministically generate TLS certificate authority and certificates out of pre-shared key
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CA ¶
type CA struct {
// contains filtered or unexported fields
}
CA is certificate authority
func NewCA ¶
NewCA creates new certificate authority using a pre-shared key. This certificate authority is generated on the fly and would yield the same private key every time for the given PSK.
That allows services that have a certain pre-shared key (i.e. shared_secret) to have automatic TLS without need to share and distribute certs, and provides a better alternative to plaintext communication, but is not a replacement for proper mTLS.
func (*CA) NewServerCert ¶
NewServerCert generates certificate for the given domain name(s)
type PEM ¶
PEM representation of certificate authority data, serializable to JSON
func ToPEM ¶
func ToPEM(key *ecdsa.PrivateKey, certDer []byte) (*PEM, error)
ToPEM converts private key and certificate into PEM representation
func (*PEM) KeyCert ¶
func (p *PEM) KeyCert() (*ecdsa.PrivateKey, *x509.Certificate, error)
KeyCert parses private key and cert from PEM encoded format