kms

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddProvider

func AddProvider(keyResourceID string, opts KMSClientOptions, init ProviderInit)

AddProvider adds the provider implementation into the local cache

func ProviderOptions

func ProviderOptions() map[string]KMSClientOptions

func SupportedProviders

func SupportedProviders() []string

SupportedProviders returns list of initialized providers

Types

type KMSClientOptions

type KMSClientOptions interface {
	Init() []registry.Configurer
	ProviderName() string
}

type KMSSignerProvider

type KMSSignerProvider struct {
	Reference  string
	KeyVersion string
	HashFunc   crypto.Hash
	Options    map[string]KMSClientOptions
}

func New

func New(opts ...Option) *KMSSignerProvider

func (*KMSSignerProvider) Signer

func (*KMSSignerProvider) Verifier

func (ksp *KMSSignerProvider) Verifier(ctx context.Context) (cryptoutil.Verifier, error)

NOTE: This is a temprorary implementation until we have a SignerVerifier interface

type Option

type Option func(*KMSSignerProvider)

func WithHash

func WithHash(hash string) Option

func WithKeyVersion

func WithKeyVersion(keyVersion string) Option

func WithRef

func WithRef(ref string) Option

type ProviderInit

type ProviderInit func(context.Context, *KMSSignerProvider) (cryptoutil.Signer, error)

ProviderInit is a function that initializes provider-specific SignerVerifier.

It takes a provider-specific resource ID and hash function, and returns a SignerVerifier using that resource, or any error that was encountered.

type ProviderNotFoundError

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

ProviderNotFoundError indicates that no matching KMS provider was found

func (*ProviderNotFoundError) Error

func (e *ProviderNotFoundError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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