certs

package
v0.0.0-...-91837a0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AvalancheCertProvider

type AvalancheCertProvider interface {
	// GetCertAndKey generates a cert and accompanying private key
	// Returns:
	// 	certPemBytes: The bytes of the generated cert
	// 	keyPemBytes: The bytes of the private key generated with the cert
	GetCertAndKey() (certPemBytes bytes.Buffer, keyPemBytes bytes.Buffer, err error)
}

AvalancheCertProvider defines an interface representing a cert provider for an Avalanche service (used in the duplicate node ID test, which requires that multiple Avalanche services start with the same cert)

type RandomAvalancheCertProvider

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

RandomAvalancheCertProvider implements AvalancheCertProviders by providing certs signed by the same root CA

func NewRandomAvalancheCertProvider

func NewRandomAvalancheCertProvider(varyCerts bool) *RandomAvalancheCertProvider

NewRandomAvalancheCertProvider creates a new cert provider that can optionally return either the same cert every time, or different ones Args:

varyCerts: True to produce a different cert on each call to GetCertAndKey, or false to yield the same
	randomly-generated cert each time

func (*RandomAvalancheCertProvider) GetCertAndKey

func (r *RandomAvalancheCertProvider) GetCertAndKey() (certPemBytes bytes.Buffer, keyPemBytes bytes.Buffer, err error)

GetCertAndKey implements AvalancheCertProvider function that yields a new cert and private key based off the configuration parameters defined at construction time Returns:

certPemBytes: The bytes of the generated cert
keyPemBytes: The bytes of the private key that was generated alongside the cert

type StaticAvalancheCertProvider

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

StaticAvalancheCertProvider implements AvalancheCertProvider and provides the same cert every time

func NewStaticAvalancheCertProvider

func NewStaticAvalancheCertProvider(key bytes.Buffer, cert bytes.Buffer) *StaticAvalancheCertProvider

NewStaticAvalancheCertProvider creates an instance of StaticAvalancheCertProvider using the given key and cert Args:

key: The private key that the StaticAvalancheCertProvider will return on every call to GetCertAndKey
cert: The cert that will be returned on every call to GetCertAndKey

func (StaticAvalancheCertProvider) GetCertAndKey

func (s StaticAvalancheCertProvider) GetCertAndKey() (certPemBytes bytes.Buffer, keyPemBytes bytes.Buffer, err error)

GetCertAndKey returns the same cert and key that was configured at the time of construction

Jump to

Keyboard shortcuts

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