testutil

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: BSD-2-Clause Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SoftHSMTestHelper

type SoftHSMTestHelper struct {
	TokenDir  string
	TokenName string
	SlotID    int
	UserPIN   string
	SOUserPIN string
	LibPath   string
	// contains filtered or unexported fields
}

SoftHSMTestHelper provides utilities for testing with SoftHSM.

func NewSoftHSMTestHelper

func NewSoftHSMTestHelper() *SoftHSMTestHelper

NewSoftHSMTestHelper creates a new SoftHSM test helper.

func SkipIfSoftHSMUnavailable

func SkipIfSoftHSMUnavailable(t *testing.T) *SoftHSMTestHelper

SkipIfSoftHSMUnavailable skips the test if SoftHSM is not available.

func (*SoftHSMTestHelper) Cleanup

func (h *SoftHSMTestHelper) Cleanup() error

Cleanup removes the temporary directory.

func (*SoftHSMTestHelper) GenerateAndImportTestCert

func (h *SoftHSMTestHelper) GenerateAndImportTestCert(keyLabel, certLabel, keyID string) error

GenerateAndImportTestCert generates a key pair and certificate in the token.

func (*SoftHSMTestHelper) GetPKCS11URI

func (h *SoftHSMTestHelper) GetPKCS11URI() string

GetPKCS11URI returns the PKCS#11 URI for the test token.

func (*SoftHSMTestHelper) IsSoftHSMAvailable

func (h *SoftHSMTestHelper) IsSoftHSMAvailable() bool

IsSoftHSMAvailable checks if SoftHSM is available on the system.

func (*SoftHSMTestHelper) Setup

func (h *SoftHSMTestHelper) Setup() error

Setup creates a new SoftHSM token for testing.

Jump to

Keyboard shortcuts

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