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.
Click to show internal directories.
Click to hide internal directories.