v0

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateCACertificate

func GenerateCACertificate() (caConfig *x509.Certificate, ca []byte, caPrivateKey *rsa.PrivateKey, err error)

GenerateCACertificate generates a certificate authority and private key for the Threeport API.

func GenerateCertificate

func GenerateCertificate(
	caConfig *x509.Certificate,
	caPrivateKey *rsa.PrivateKey,
	altNames ...string,
) (certificate string, privateKey string, err error)

GenerateCertificate generates a certificate and private key for the current Threeport instance.

func GetCertificatePEMEncoding

func GetCertificatePEMEncoding(cert []byte) string

GetCertificatePEMEncoding returns a PEM encoded string for a given certificate.

func GetPEMEncoding

func GetPEMEncoding(cert []byte, encodingType string) (pemEncodingString string)

GetPEMEncoding returns a PEM encoded string for a given certificate or private key.

func GetPrivateKeyPEMEncoding

func GetPrivateKeyPEMEncoding(privateKey *rsa.PrivateKey) string

GetPrivateKeyPEMEncoding returns a PEM encoded string for a given private key.

Types

type AuthConfig

type AuthConfig struct {
	CAConfig                  *x509.Certificate
	CAPrivateKey              rsa.PrivateKey
	CA                        []byte
	CAPemEncoded              string
	CABase64Encoded           string
	CAPrivateKeyPemEncoded    string
	CAPrivateKeyBase64Encoded string
}

AuthConfig contains root CA and private key for generating client certificates.

func GetAuthConfig

func GetAuthConfig() (*AuthConfig, error)

GetAuthConfig populates an AuthConfig object and returns a pointer to it.

Jump to

Keyboard shortcuts

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