tls

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2022 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CertificateAuthority

type CertificateAuthority struct {
	CertificateKeyPair
}

CertificateAuthority represents self-signed certificate/key pair which can create signed derived certificates

func CreateAuthority

func CreateAuthority(template *x509.Certificate) (*CertificateAuthority, error)

CreateAuthority creates new self signed certificate with given x509 data

func (*CertificateAuthority) CreateDerived

func (ca *CertificateAuthority) CreateDerived(template *x509.Certificate) (*CertificateKeyPair, error)

CreateDerived creates new certificate/key by given x509 data and signed by current authority

type CertificateKeyPair

type CertificateKeyPair struct {
	// contains filtered or unexported fields
}

CertificateKeyPair represents x509 type certificate and corresponding private key

func (*CertificateKeyPair) KeyToPEMFormat

func (ckp *CertificateKeyPair) KeyToPEMFormat() string

KeyToPEMFormat returns private key serialized to string by PEM encoding rules

func (*CertificateKeyPair) ToPEMFormat

func (ckp *CertificateKeyPair) ToPEMFormat() string

ToPEMFormat method returns certificate serialized to string by PEM encoding rules

type Primitives

type Primitives struct {
	CertificateAuthority *CertificateAuthority
	ServerCertificate    *CertificateKeyPair
	PresharedKey         *TLSPresharedKey
}

Primitives structure holds TLS primitives required to setup basic cryptographics for openvpn server/client

func NewTLSPrimitives

func NewTLSPrimitives(caCertSubject, serverCertSubject pkix.Name) (*Primitives, error)

NewTLSPrimitives function creates TLS primitives for given service location and provider id

type TLSPresharedKey

type TLSPresharedKey []byte

TLSPresharedKey defines TLS preshared key type

func (TLSPresharedKey) ToPEMFormat

func (key TLSPresharedKey) ToPEMFormat() string

ToPEMFormat renders TLS preshared key to PEM compatible string which can be written to PEM file

Jump to

Keyboard shortcuts

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