istio: Index | Files

package mock

import ""


Package Files


type FakeKeyCertBundle Uses

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

FakeKeyCertBundle is a mocked KeyCertBundle for testing.

func (*FakeKeyCertBundle) CertOptions Uses

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

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

func (*FakeKeyCertBundle) ExtractCACertExpiryTimestamp Uses

func (b *FakeKeyCertBundle) ExtractCACertExpiryTimestamp() (float64, error)

ExtractCACertExpiryTimestamp returns the unix timestamp when the CA cert becomes expires.

func (*FakeKeyCertBundle) ExtractRootCertExpiryTimestamp Uses

func (b *FakeKeyCertBundle) ExtractRootCertExpiryTimestamp() (float64, error)

ExtractRootCertExpiryTimestamp returns the unix timestamp when the root becomes expires.

func (*FakeKeyCertBundle) GetAll Uses

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 Uses

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 Uses

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

GetCertChainPem returns CertChainBytes.

func (*FakeKeyCertBundle) GetRootCertPem Uses

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

GetRootCertPem returns RootCertBytes.

func (*FakeKeyCertBundle) VerifyAndSetAll Uses

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.

Package mock imports 4 packages (graph) and is imported by 1 packages. Updated 2020-08-23. Refresh now. Tools for package owners.