testutil

package
v0.9.10 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: BSD-2-Clause Imports: 13 Imported by: 0

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