Documentation ¶
Index ¶
- func Delete(ctx context.Context, id string, providerType KeyProviderType) error
- func RegisterKeyProvider(k KeyProvider, providerType KeyProviderType) error
- func Store(ctx context.Context, id string, pemBytes []byte, providerType KeyProviderType) error
- type Key
- type KeyProvider
- type KeyProviderType
- type KeyScheme
- type KeyType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete(ctx context.Context, id string, providerType KeyProviderType) error
Delete goes to the specified key provider and deletes the Key returns a nil error when successful
func RegisterKeyProvider ¶
func RegisterKeyProvider(k KeyProvider, providerType KeyProviderType) error
Types ¶
type Key ¶
type Key struct { // Hash sha256 hash of the canonical representation of the key Hash string // Type represents the type of the key Type KeyType // Key is the crypto.PublicKey of the public key Val crypto.PublicKey // Scheme is the supported scheme by the key type. Scheme KeyScheme }
type KeyProvider ¶
type KeyProvider interface { // RetrieveKey takes in the ID (which is commonly the hash of the key) // and it retrieves the wrapped key struct that is associated // Returns nil, nil if no keys are found // Return nil, error if the request to the provider failed RetrieveKey(ctx context.Context, id string) (*Key, error) // StoreKey takes in the ID and the crypto.PublicKey and stores them // for future retrieval. If key id is already present, it replaces // the key with the new one StoreKey(ctx context.Context, id string, pk *Key) error // DeleteKey takes in the ID and will remove the associated key from the provider DeleteKey(ctx context.Context, id string) error // Type returns the key provider type Type() KeyProviderType }
type KeyProviderType ¶
type KeyProviderType string
Click to show internal directories.
Click to hide internal directories.