reenroller

package
v1.0.4-2 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HSMClient is the name of container that contain the HSM client library
	HSMClient = "hsm-client"
	// CertGen is the name of container that runs the command to generate the certificate for the CA
	CertGen = "certgen"
)

Variables

This section is empty.

Functions

func EnrollmentConfigValidation

func EnrollmentConfigValidation(enrollConfig *current.Enrollment) error

func GetClient

func GetClient(client *lib.Client, bccsp *commonapi.BCCSP) *lib.Client

Types

type HSMDaemonReenroller

type HSMDaemonReenroller struct {
	CAClient *lib.Client
	Identity Identity

	HomeDir   string
	Config    *current.Enrollment
	BCCSP     bool
	Timeout   time.Duration
	HSMConfig *config.HSMConfig
	Instance  Instance
	Client    k8sclient.Client
	Scheme    *runtime.Scheme
	NewKey    bool
}

func NewHSMDaemonReenroller

func NewHSMDaemonReenroller(cfg *current.Enrollment, homeDir string, bccsp *commonapi.BCCSP, timeoutstring string, hsmConfig *config.HSMConfig, instance Instance, client k8sclient.Client, scheme *runtime.Scheme, newKey bool) (*HSMDaemonReenroller, error)

func (*HSMDaemonReenroller) IsCAReachable

func (r *HSMDaemonReenroller) IsCAReachable() bool

func (*HSMDaemonReenroller) Reenroll

func (r *HSMDaemonReenroller) Reenroll() (*config.Response, error)

type HSMReenroller

type HSMReenroller struct {
	CAClient *lib.Client
	Identity Identity

	HomeDir   string
	Config    *current.Enrollment
	BCCSP     bool
	Timeout   time.Duration
	HSMConfig *config.HSMConfig
	Instance  Instance
	Client    k8sclient.Client
	Scheme    *runtime.Scheme
	NewKey    bool
}

func NewHSMReenroller

func NewHSMReenroller(cfg *current.Enrollment, homeDir string, bccsp *commonapi.BCCSP, timeoutstring string, hsmConfig *config.HSMConfig, instance Instance, client k8sclient.Client, scheme *runtime.Scheme, newKey bool) (*HSMReenroller, error)

func (*HSMReenroller) IsCAReachable

func (r *HSMReenroller) IsCAReachable() bool

func (*HSMReenroller) Reenroll

func (r *HSMReenroller) Reenroll() (*config.Response, error)

type Identity

type Identity interface {
	Reenroll(req *api.ReenrollmentRequest) (*lib.EnrollmentResponse, error)
	GetECert() *fabricx509.Signer
	GetClient() *lib.Client
}

type Instance

type Instance interface {
	metav1.Object
	EnrollerImage() string
	GetPullSecrets() []corev1.LocalObjectReference
	GetResource(current.Component) corev1.ResourceRequirements
	PVCName() string
}

type Reenroller

type Reenroller struct {
	Client   *lib.Client
	Identity Identity

	HomeDir string
	Config  *current.Enrollment
	BCCSP   bool
	Timeout time.Duration
	NewKey  bool
}

func New

func New(cfg *current.Enrollment, homeDir string, bccsp *commonapi.BCCSP, timeoutstring string, newKey bool) (*Reenroller, error)

func (*Reenroller) DeleteKeystoreFile

func (r *Reenroller) DeleteKeystoreFile() error

func (*Reenroller) InitClient

func (r *Reenroller) InitClient() error

func (*Reenroller) IsCAReachable

func (r *Reenroller) IsCAReachable() bool

func (*Reenroller) LoadIdentity

func (r *Reenroller) LoadIdentity(certPemBytes []byte, keyPemBytes []byte, hsmEnabled bool) error

func (*Reenroller) ReadKey

func (r *Reenroller) ReadKey() ([]byte, error)

func (*Reenroller) Reenroll

func (r *Reenroller) Reenroll() (*config.Response, error)

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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