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 }
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