mock

package
v0.0.0-...-1a56975 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeKeyCertBundle

type FakeKeyCertBundle struct {
	CertBytes       []byte
	Cert            *x509.Certificate
	PrivKeyBytes    []byte
	PrivKey         *crypto.PrivateKey
	CertChainBytes  []byte
	RootCertBytes   []byte
	VerificationErr error
	CertOptionsErr  error
	// contains filtered or unexported fields
}

FakeKeyCertBundle is a mocked KeyCertBundle for testing.

func (*FakeKeyCertBundle) CertOptions

func (b *FakeKeyCertBundle) CertOptions() (*util.CertOptions, error)

CertOptions returns CertOptionsErr if it is not nil. Otherwise it returns an empty CertOptions.

func (*FakeKeyCertBundle) GetAll

func (b *FakeKeyCertBundle) GetAll() (cert *x509.Certificate, privKey *crypto.PrivateKey, certChainBytes,
	rootCertBytes []byte)

GetAll returns all key/cert in KeyCertBundle together. Getting all values together avoids inconsistency.

func (*FakeKeyCertBundle) GetAllPem

func (b *FakeKeyCertBundle) GetAllPem() (certBytes, privKeyBytes, certChainBytes, rootCertBytes []byte)

GetAllPem returns all key/cert PEMs in KeyCertBundle together. Getting all values together avoids inconsistency.

func (*FakeKeyCertBundle) GetCertChainPem

func (b *FakeKeyCertBundle) GetCertChainPem() []byte

GetCertChainPem returns CertChainBytes.

func (*FakeKeyCertBundle) GetRootCertPem

func (b *FakeKeyCertBundle) GetRootCertPem() []byte

GetRootCertPem returns RootCertBytes.

func (*FakeKeyCertBundle) VerifyAndSetAll

func (b *FakeKeyCertBundle) VerifyAndSetAll(certBytes, privKeyBytes, certChainBytes, rootCertBytes []byte) error

VerifyAndSetAll returns VerificationErr if it is not nil. Otherwise, it returns all the key/certs in the bundle.

Jump to

Keyboard shortcuts

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