license

package module
v0.0.0-...-8312e71 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 5 Imported by: 12

README

license

CA and licensing tools

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeTLSCert

func MakeTLSCert(license License) (*tls.Certificate, error)

MakeTLSCert takes the provided license and makes a TLS certificate which is the format used by Go servers

func MakeTLSConfig

func MakeTLSConfig(license License) (*tls.Config, error)

MakeTLSConfig builds a client TLS config from the supplied license

func SplitPEM

func SplitPEM(pemData []byte) (certPEM []byte, keyPEM []byte, err error)

SplitPEM splits the provided PEM data that contains concatenated cert and key (in any order) into cert PEM and key PEM respectively. Returns an error if any of them is missing

Types

type License

type License struct {
	// Cert is the x509 license certificate
	Cert *x509.Certificate
	// RawPayload contains raw license payload
	RawPayload []byte
	// CertPEM is the certificate part of the license in PEM format
	CertPEM []byte
	// KeyPEM is the private key part of the license in PEM Format,
	// may be empty if the license was parsed from certificate only
	KeyPEM []byte
	// AnonymizationKey is a key used to anonymize usage data, may be empty
	AnonymizationKey []byte
}

License represents Gravitational license

func ParseLicensePEM

func ParseLicensePEM(pem []byte) (*License, error)

ParseLicensePEM parses license PEM, parses payload on demand

func ParseX509

func ParseX509(cert *x509.Certificate) (*License, error)

ParseX509 parses the license from the provided x509 certificate

func (*License) Verify

func (l *License) Verify(caPEM []byte) error

Verify makes sure the license is valid

Directories

Path Synopsis
package authority implements X509 certificate authority features
package authority implements X509 certificate authority features

Jump to

Keyboard shortcuts

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