mock

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrForcedError             = errors.New("simulated certificate creation failure")
	ErrMarshalPrivateKeyFailed = errors.New("failed to marshal private key")
)

Functions

This section is empty.

Types

type CertCreator

type CertCreator struct {
	ShouldReturnErrorForCert bool
	ShouldReturnErrorForKey  bool
}

CertCreator is a mock certificate creator

func (*CertCreator) CreateCertificate

func (c *CertCreator) CreateCertificate(
	io.Reader,
	*x509.Certificate, *x509.Certificate,
	any, any) ([]byte, error)

CreateCertificate creates a certificate

func (*CertCreator) MarshalECPrivateKey

func (c *CertCreator) MarshalECPrivateKey(*ecdsa.PrivateKey) ([]byte, error)

type PEMEncoder

type PEMEncoder struct {
	ShouldReturnError int
	// contains filtered or unexported fields
}

PEMEncoder is a mock implementation of the PEMEncoder interface.

func (*PEMEncoder) Encode

func (e *PEMEncoder) Encode(out io.Writer, block *pem.Block) error

Encode writes the PEM encoding of block to out.

Jump to

Keyboard shortcuts

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