aws

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package aws is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSuite added in v1.5.0

func NewSuite(awsConfig *aws.Config,
	metrics metricsProvider,
	healthCheckKeyID string,
	opts ...Opts,
) api.Suite

NewSuite returns a api.Suite built on top of aws kms.

Types

type MockawsClient

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

MockawsClient is a mock of awsClient interface.

func NewMockawsClient

func NewMockawsClient(ctrl *gomock.Controller) *MockawsClient

NewMockawsClient creates a new mock instance.

func (*MockawsClient) CreateAlias

func (m *MockawsClient) CreateAlias(ctx context.Context, params *kms.CreateAliasInput, optFns ...func(*kms.Options)) (*kms.CreateAliasOutput, error)

CreateAlias mocks base method.

func (*MockawsClient) CreateKey

func (m *MockawsClient) CreateKey(ctx context.Context, params *kms.CreateKeyInput, optFns ...func(*kms.Options)) (*kms.CreateKeyOutput, error)

CreateKey mocks base method.

func (*MockawsClient) Decrypt

func (m *MockawsClient) Decrypt(ctx context.Context, params *kms.DecryptInput, optFns ...func(*kms.Options)) (*kms.DecryptOutput, error)

Decrypt mocks base method.

func (*MockawsClient) DescribeKey

func (m *MockawsClient) DescribeKey(ctx context.Context, params *kms.DescribeKeyInput, optFns ...func(*kms.Options)) (*kms.DescribeKeyOutput, error)

DescribeKey mocks base method.

func (*MockawsClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockawsClient) Encrypt

func (m *MockawsClient) Encrypt(ctx context.Context, params *kms.EncryptInput, optFns ...func(*kms.Options)) (*kms.EncryptOutput, error)

Encrypt mocks base method.

func (*MockawsClient) GetPublicKey

func (m *MockawsClient) GetPublicKey(ctx context.Context, params *kms.GetPublicKeyInput, optFns ...func(*kms.Options)) (*kms.GetPublicKeyOutput, error)

GetPublicKey mocks base method.

func (*MockawsClient) ScheduleKeyDeletion added in v1.10.0

func (m *MockawsClient) ScheduleKeyDeletion(ctx context.Context, params *kms.ScheduleKeyDeletionInput, optFns ...func(*kms.Options)) (*kms.ScheduleKeyDeletionOutput, error)

ScheduleKeyDeletion mocks base method.

func (*MockawsClient) Sign

func (m *MockawsClient) Sign(ctx context.Context, params *kms.SignInput, optFns ...func(*kms.Options)) (*kms.SignOutput, error)

Sign mocks base method.

func (*MockawsClient) Verify

func (m *MockawsClient) Verify(ctx context.Context, params *kms.VerifyInput, optFns ...func(*kms.Options)) (*kms.VerifyOutput, error)

Verify mocks base method.

type MockawsClientMockRecorder

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

MockawsClientMockRecorder is the mock recorder for MockawsClient.

func (*MockawsClientMockRecorder) CreateAlias

func (mr *MockawsClientMockRecorder) CreateAlias(ctx, params interface{}, optFns ...interface{}) *awsClientCreateAliasCall

CreateAlias indicates an expected call of CreateAlias.

func (*MockawsClientMockRecorder) CreateKey

func (mr *MockawsClientMockRecorder) CreateKey(ctx, params interface{}, optFns ...interface{}) *awsClientCreateKeyCall

CreateKey indicates an expected call of CreateKey.

func (*MockawsClientMockRecorder) Decrypt

func (mr *MockawsClientMockRecorder) Decrypt(ctx, params interface{}, optFns ...interface{}) *awsClientDecryptCall

Decrypt indicates an expected call of Decrypt.

func (*MockawsClientMockRecorder) DescribeKey

func (mr *MockawsClientMockRecorder) DescribeKey(ctx, params interface{}, optFns ...interface{}) *awsClientDescribeKeyCall

DescribeKey indicates an expected call of DescribeKey.

func (*MockawsClientMockRecorder) Encrypt

func (mr *MockawsClientMockRecorder) Encrypt(ctx, params interface{}, optFns ...interface{}) *awsClientEncryptCall

Encrypt indicates an expected call of Encrypt.

func (*MockawsClientMockRecorder) GetPublicKey

func (mr *MockawsClientMockRecorder) GetPublicKey(ctx, params interface{}, optFns ...interface{}) *awsClientGetPublicKeyCall

GetPublicKey indicates an expected call of GetPublicKey.

func (*MockawsClientMockRecorder) ScheduleKeyDeletion added in v1.10.0

func (mr *MockawsClientMockRecorder) ScheduleKeyDeletion(ctx, params interface{}, optFns ...interface{}) *awsClientScheduleKeyDeletionCall

ScheduleKeyDeletion indicates an expected call of ScheduleKeyDeletion.

func (*MockawsClientMockRecorder) Sign

func (mr *MockawsClientMockRecorder) Sign(ctx, params interface{}, optFns ...interface{}) *awsClientSignCall

Sign indicates an expected call of Sign.

func (*MockawsClientMockRecorder) Verify

func (mr *MockawsClientMockRecorder) Verify(ctx, params interface{}, optFns ...interface{}) *awsClientVerifyCall

Verify indicates an expected call of Verify.

type MockmetricsProvider

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

MockmetricsProvider is a mock of metricsProvider interface.

func NewMockmetricsProvider

func NewMockmetricsProvider(ctrl *gomock.Controller) *MockmetricsProvider

NewMockmetricsProvider creates a new mock instance.

func (*MockmetricsProvider) DecryptCount

func (m *MockmetricsProvider) DecryptCount()

DecryptCount mocks base method.

func (*MockmetricsProvider) DecryptTime

func (m *MockmetricsProvider) DecryptTime(value time.Duration)

DecryptTime mocks base method.

func (*MockmetricsProvider) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockmetricsProvider) EncryptCount

func (m *MockmetricsProvider) EncryptCount()

EncryptCount mocks base method.

func (*MockmetricsProvider) EncryptTime

func (m *MockmetricsProvider) EncryptTime(value time.Duration)

EncryptTime mocks base method.

func (*MockmetricsProvider) ExportPublicKeyCount

func (m *MockmetricsProvider) ExportPublicKeyCount()

ExportPublicKeyCount mocks base method.

func (*MockmetricsProvider) ExportPublicKeyTime

func (m *MockmetricsProvider) ExportPublicKeyTime(value time.Duration)

ExportPublicKeyTime mocks base method.

func (*MockmetricsProvider) SignCount

func (m *MockmetricsProvider) SignCount()

SignCount mocks base method.

func (*MockmetricsProvider) SignTime

func (m *MockmetricsProvider) SignTime(value time.Duration)

SignTime mocks base method.

func (*MockmetricsProvider) VerifyCount

func (m *MockmetricsProvider) VerifyCount()

VerifyCount mocks base method.

func (*MockmetricsProvider) VerifyTime

func (m *MockmetricsProvider) VerifyTime(value time.Duration)

VerifyTime mocks base method.

type MockmetricsProviderMockRecorder

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

MockmetricsProviderMockRecorder is the mock recorder for MockmetricsProvider.

func (*MockmetricsProviderMockRecorder) DecryptCount

func (mr *MockmetricsProviderMockRecorder) DecryptCount() *metricsProviderDecryptCountCall

DecryptCount indicates an expected call of DecryptCount.

func (*MockmetricsProviderMockRecorder) DecryptTime

func (mr *MockmetricsProviderMockRecorder) DecryptTime(value interface{}) *metricsProviderDecryptTimeCall

DecryptTime indicates an expected call of DecryptTime.

func (*MockmetricsProviderMockRecorder) EncryptCount

func (mr *MockmetricsProviderMockRecorder) EncryptCount() *metricsProviderEncryptCountCall

EncryptCount indicates an expected call of EncryptCount.

func (*MockmetricsProviderMockRecorder) EncryptTime

func (mr *MockmetricsProviderMockRecorder) EncryptTime(value interface{}) *metricsProviderEncryptTimeCall

EncryptTime indicates an expected call of EncryptTime.

func (*MockmetricsProviderMockRecorder) ExportPublicKeyCount

func (mr *MockmetricsProviderMockRecorder) ExportPublicKeyCount() *metricsProviderExportPublicKeyCountCall

ExportPublicKeyCount indicates an expected call of ExportPublicKeyCount.

func (*MockmetricsProviderMockRecorder) ExportPublicKeyTime

func (mr *MockmetricsProviderMockRecorder) ExportPublicKeyTime(value interface{}) *metricsProviderExportPublicKeyTimeCall

ExportPublicKeyTime indicates an expected call of ExportPublicKeyTime.

func (*MockmetricsProviderMockRecorder) SignCount

func (mr *MockmetricsProviderMockRecorder) SignCount() *metricsProviderSignCountCall

SignCount indicates an expected call of SignCount.

func (*MockmetricsProviderMockRecorder) SignTime

func (mr *MockmetricsProviderMockRecorder) SignTime(value interface{}) *metricsProviderSignTimeCall

SignTime indicates an expected call of SignTime.

func (*MockmetricsProviderMockRecorder) VerifyCount

func (mr *MockmetricsProviderMockRecorder) VerifyCount() *metricsProviderVerifyCountCall

VerifyCount indicates an expected call of VerifyCount.

func (*MockmetricsProviderMockRecorder) VerifyTime

func (mr *MockmetricsProviderMockRecorder) VerifyTime(value interface{}) *metricsProviderVerifyTimeCall

VerifyTime indicates an expected call of VerifyTime.

type Opts

type Opts func(opts *opts)

Opts a Functional Options.

func WithAWSClient

func WithAWSClient(client awsClient) Opts

WithAWSClient sets custom AWS client.

func WithAWSEndpointResolverV2 added in v1.11.0

func WithAWSEndpointResolverV2(resolver kms.EndpointResolverV2) Opts

func WithEncryptionAlgorithm

func WithEncryptionAlgorithm(algo string) Opts

WithEncryptionAlgorithm sets the encryption\decryption algorithm Opts.

func WithKeyAliasPrefix

func WithKeyAliasPrefix(prefix string) Opts

WithKeyAliasPrefix sets the given prefix in the returns Opts.

type Service

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

Service aws kms.

func New

func New(
	awsConfig *aws.Config,
	metrics metricsProvider,
	healthCheckKeyID string,
	opts ...Opts,
) *Service

New return aws service.

func (*Service) Create

func (s *Service) Create(kt arieskms.KeyType) (string, interface{}, error)

Create key.

func (*Service) CreateAndExportPubKeyBytes

func (s *Service) CreateAndExportPubKeyBytes(kt arieskms.KeyType, _ ...arieskms.KeyOpts) (string, []byte, error)

CreateAndExportPubKeyBytes create and export key.

func (*Service) Decrypt

func (s *Service) Decrypt(cipher, _, _ []byte, kh interface{}) ([]byte, error)

Decrypt data.

func (*Service) Encrypt

func (s *Service) Encrypt(
	msg []byte,
	_ []byte,
	kh interface{},
) ([]byte, []byte, error)

Encrypt data.

func (*Service) ExportPubKeyBytes

func (s *Service) ExportPubKeyBytes(keyURI string) ([]byte, arieskms.KeyType, error)

ExportPubKeyBytes export public key.

func (*Service) Get

func (s *Service) Get(keyID string) (interface{}, error)

Get key handle.

func (*Service) HealthCheck

func (s *Service) HealthCheck() error

HealthCheck check kms.

func (*Service) ImportPrivateKey

func (s *Service) ImportPrivateKey(_ interface{}, _ arieskms.KeyType,
	_ ...arieskms.PrivateKeyOpts) (string, interface{}, error)

ImportPrivateKey private key.

func (*Service) Remove added in v1.10.0

func (s *Service) Remove(keyURI string) error

Remove removes kms key referenced by keyURI from KMS.

func (*Service) Sign

func (s *Service) Sign(msg []byte, kh interface{}) ([]byte, error)

Sign data.

func (*Service) SignMulti

func (s *Service) SignMulti(_ [][]byte, _ interface{}) ([]byte, error)

SignMulti sign multi.

func (*Service) Verify

func (s *Service) Verify(_, _ []byte, _ interface{}) error

Verify signature.

Jump to

Keyboard shortcuts

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