Documentation ¶
Index ¶
- type Config
- type KeyControl
- func (kc *KeyControl) Close() error
- func (kc *KeyControl) Create(ctx context.Context, name string, key []byte) error
- func (kc *KeyControl) Delete(ctx context.Context, name string) error
- func (kc *KeyControl) Get(ctx context.Context, name string) ([]byte, error)
- func (kc *KeyControl) List(ctx context.Context, prefix string, n int) ([]string, string, error)
- func (kc *KeyControl) Set(ctx context.Context, name string, key []byte) error
- func (kc *KeyControl) Status(ctx context.Context) (kes.KeyStoreState, error)
- func (kc *KeyControl) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Endpoint is the URL of the KeyControl endpoint. Endpoint string // VaultID is the UUID of the KeyControl Vault. VaultID string // BoxID is the ID or name of the box inside the Vault. BoxID string // Username is the username used for authentication. Username string // Password is the password associated with the provided username. Password string // TLS holds the TLS configuration. In particular, a custom root // CAs may be provided. TLS *tls.Config }
Config is a structure containing the Entrust KeyControl configuration.
type KeyControl ¶
type KeyControl struct {
// contains filtered or unexported fields
}
KeyControl represents a client for interacting with a KeyControl server.
func Login ¶
func Login(ctx context.Context, config *Config) (*KeyControl, error)
Login authenticates the user and establishes a connection to KeyControl instance.
func (*KeyControl) Close ¶
func (kc *KeyControl) Close() error
Close closes the KeyControl client. It stops any authentication renewal in the background.
func (*KeyControl) Create ¶
Create creates the given key-value pair at the KeyControl server if and only if the given key does not exist. If such an entry already exists it returns kes.ErrKeyExists.
func (*KeyControl) Delete ¶
func (kc *KeyControl) Delete(ctx context.Context, name string) error
Delete removes a the value associated with the given key from the KeyControl server, if it exists.
func (*KeyControl) Get ¶
Get returns the value associated with the given key. If no entry for the key exists it returns kes.ErrKeyNotFound.
func (*KeyControl) List ¶
List returns the first n key names, that start with the given prefix, and the next prefix from which the listing should continue.
It returns all keys with the prefix if n < 0 and less than n names if n is greater than the number of keys with the prefix.
An empty prefix matches any key name. At the end of the listing or when there are no (more) keys starting with the prefix, the returned prefix is empty.
func (*KeyControl) Set ¶
Set creates the given key-value pair at the KeyControl server if and only if the given key does not exist. If such an entry already exists it returns kes.ErrKeyExists.
func (*KeyControl) Status ¶
func (kc *KeyControl) Status(ctx context.Context) (kes.KeyStoreState, error)
Status returns the current state of the KeyControl instance. In particular, whether it is reachable and the network latency.
func (*KeyControl) String ¶
func (kc *KeyControl) String() string