Documentation ¶
Index ¶
- func DecodeCertificates(value []byte) ([]*x509.Certificate, error)
- func DecodeKey(value []byte) (crypto.PublicKey, error)
- func DeleteResourceFromMap(resource string)
- func FlattenKMPMap(certMap map[KMPMapKey][]*x509.Certificate) []*x509.Certificate
- func GetCertificatesFromMap(ctx context.Context, resource string) (map[KMPMapKey][]*x509.Certificate, error)
- func GetKeysFromMap(ctx context.Context, resource string) (map[KMPMapKey]PublicKey, error)
- func SaveSecrets(resource, providerType string, keys map[KMPMapKey]crypto.PublicKey, ...)
- func SetCertificateError(resource string, err error)
- func SetKeyError(resource string, err error)
- type KMPMapKey
- type KeyManagementProvider
- type KeyManagementProviderStatus
- type PublicKey
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 ¶
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 DeleteResourceFromMap ¶
func DeleteResourceFromMap(resource string)
DeleteResourceFromMap deletes the certificates, keys and errors from the map it is concurrency-safe
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 ¶
GetKeysFromMap gets the keys from the map and returns an empty map if not found or an error happened.
func SaveSecrets ¶
func SaveSecrets(resource, providerType string, keys map[KMPMapKey]crypto.PublicKey, certs map[KMPMapKey][]*x509.Certificate)
SaveSecrets saves the keys and certificates in the map.
func SetCertificateError ¶
SetCertificateError sets the error while fetching certificates from key management provider.
func SetKeyError ¶
SetKeyError sets the error while fetching keys from key management provider.
Types ¶
type KMPMapKey ¶
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) // Returns if the provider supports refreshing of certificates/keys IsRefreshable() bool }
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