testutils

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SetupCMM = func(keyIDs []string, opts ...func(options *config.LoadOptions) error) model.CryptoMaterialsManager {
	var kp model.MasterKeyProvider
	if len(keyIDs) > 0 {
		keyProvider, err := kmsprovider.NewWithOpts(
			keyIDs,
			kmsprovider.WithAwsLoadOptions(opts...),
		)
		if err != nil {
			log.Error().Err(err).Msg("setupCMM")
			return nil
		}
		kp = keyProvider
	} else {
		keyProvider, err := kmsprovider.NewWithOpts(
			nil,
			kmsprovider.WithAwsLoadOptions(opts...),
			kmsprovider.WithDiscovery(),
		)
		if err != nil {
			log.Error().Err(err).Msg("setupCMM")
			return nil
		}
		kp = keyProvider
	}

	cmm, _ := materials.NewDefault(kp)

	return cmm
}
View Source
var SetupDecryptCmd = func(keyIDs []string, ec map[string]string, frame int, edk int, alg string) *CliCmd {
	return NewDecryptCmd(keyIDs, ec, frame, edk)
}
View Source
var SetupEncryptCmd = func(keyIDs []string, ec map[string]string, frame int, edk int, alg string) *CliCmd {
	return NewEncryptCmd(keyIDs, ec, frame, edk, alg)
}

Functions

func AlgSuffix

func AlgSuffix(as *suite.AlgorithmSuite) string

Types

type CliCmd

type CliCmd struct {
	// contains filtered or unexported fields
}

func NewDecryptCmd

func NewDecryptCmd(keyIDs []string, ec map[string]string, frame, edk int) *CliCmd

func NewEncryptCmd

func NewEncryptCmd(keyIDs []string, ec map[string]string, frame, edk int, alg string) *CliCmd

func NewVersionCmd

func NewVersionCmd() *CliCmd

func (*CliCmd) Run

func (c *CliCmd) Run(input []byte, wantErr bool) (output []byte, err error)

Jump to

Keyboard shortcuts

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