keymanagementprovider

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeCertificates

func DecodeCertificates(value []byte) ([]*x509.Certificate, error)

DecodeCertificates decodes PEM-encoded bytes into an x509.Certificate chain.

func DecodeKey

func DecodeKey(value []byte) (crypto.PublicKey, error)

DecodeKey takes in a PEM encoded byte array and returns a public key PEM encoded byte array is expected to be a single public key. If multiple are provided, the first one is returned

func DeleteCertificatesFromMap

func DeleteCertificatesFromMap(resource string)

DeleteCertificatesFromMap deletes the certificates from the map it is concurrency-safe

func DeleteKeysFromMap

func DeleteKeysFromMap(resource string)

DeleteKeysFromMap deletes the keys from the map

func FlattenKMPMap

func FlattenKMPMap(certMap map[KMPMapKey][]*x509.Certificate) []*x509.Certificate

FlattenKMPMap flattens the map of certificates fetched for a single key management provider resource and returns a single array

func GetCertificatesFromMap

func GetCertificatesFromMap(ctx context.Context, resource string) (map[KMPMapKey][]*x509.Certificate, error)

GetCertificatesFromMap gets the certificates from the map and returns an empty map of certificate arrays if not found or an error happened.

func GetKeysFromMap

func GetKeysFromMap(ctx context.Context, resource string) (map[KMPMapKey]PublicKey, error)

GetKeysFromMap gets the keys from the map and returns an empty map if not found or an error happened.

func SetCertificatesInMap

func SetCertificatesInMap(resource string, certs map[KMPMapKey][]*x509.Certificate)

SetCertificatesInMap sets the certificates in the map it is concurrency-safe

func SetKeysInMap

func SetKeysInMap(resource string, providerType string, keys map[KMPMapKey]crypto.PublicKey)

SetKeysInMap sets the keys in the map

Types

type KMPMapKey

type KMPMapKey struct {
	Name    string
	Version string
}

KMPMapKey is a key for the map of certificates fetched for a single key management provider resource

type KeyManagementProvider

type KeyManagementProvider interface {
	// Returns an array of certificates and the provider specific cert attributes
	GetCertificates(ctx context.Context) (map[KMPMapKey][]*x509.Certificate, KeyManagementProviderStatus, error)
	// Returns an array of keys and the provider specific key attributes
	GetKeys(ctx context.Context) (map[KMPMapKey]crypto.PublicKey, KeyManagementProviderStatus, error)
}

KeyManagementProvider is an interface that defines methods to be implemented by a each key management provider provider

type KeyManagementProviderStatus

type KeyManagementProviderStatus map[string]interface{}

This is a map of properties for fetched certificates/keys The key and values are specific to each provider

type PublicKey

type PublicKey struct {
	Key          crypto.PublicKey
	ProviderType string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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