entrust

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

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.

func (*Config) Clone

func (c *Config) Clone() *Config

Clone returns a deep copy of the Config.

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

func (kc *KeyControl) Create(ctx context.Context, name string, key []byte) error

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

func (kc *KeyControl) Get(ctx context.Context, name string) ([]byte, error)

Get returns the value associated with the given key. If no entry for the key exists it returns kes.ErrKeyNotFound.

func (*KeyControl) List

func (kc *KeyControl) List(ctx context.Context, prefix string, n int) ([]string, string, error)

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

func (kc *KeyControl) Set(ctx context.Context, name string, key []byte) error

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

Jump to

Keyboard shortcuts

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