Documentation ¶
Index ¶
- type APIKey
- type Config
- type Store
- func (s *Store) Close() error
- func (s *Store) Create(ctx context.Context, name string, value []byte) error
- func (s *Store) Delete(ctx context.Context, name string) error
- func (s *Store) Get(ctx context.Context, name string) ([]byte, error)
- func (s *Store) List(ctx context.Context, prefix string, n int) ([]string, string, error)
- func (s *Store) Set(ctx context.Context, name string, value []byte) error
- func (s *Store) Status(ctx context.Context) (kes.KeyStoreState, error)
- func (s *Store) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIKey ¶
type APIKey string
APIKey is a Fortanix API key for authenticating to a Fortanix SDKMS instance.
type Config ¶
type Config struct { // Endpoint is the Fortanix SDKMS instance endpoint. Endpoint string // GroupID is ID of the Fortanix SDKMS group newly created // keys will belong to. // // Fortanix SDKMS uses groups as collection of (security) objects. // Typically, applications can access some/all objects within groups // the application is assigned to. GroupID string // APIKey is the application's Fortanix SDKMS API key used to authenticate // operations. It is sent on each request as part of the request headers. APIKey APIKey // CAPath is an optional path to a CA certificate or directory // containing CA certificates. // // If not empty, the KeyStore will use the specified CAs to // verify the Fortanix SDKMS server certificate. CAPath string }
Config is a structure containing configuration options for connecting to a Fortanix SDKMS server.
type Store ¶ added in v0.23.0
type Store struct {
// contains filtered or unexported fields
}
Store is a Fortanix SDKMS secret store.
func Connect ¶
Connect establishes and returns a Store to a Fortanix SDKMS server using the given config.
func (*Store) Create ¶ added in v0.23.0
Create stores the given key at the Fortanix SDKMS if and only if no entry with the given name exists.
If no such entry exists, Create returns kes.ErrKeyExists.
func (*Store) Delete ¶ added in v0.23.0
Delete deletes the key associated with the given name from the Fortanix SDKMS. It may not return an error if no entry for the given name exists.
func (*Store) Get ¶ added in v0.23.0
Get returns the key associated with the given name.
If there is no such entry, Get returns kes.ErrKeyNotFound.
func (*Store) List ¶ added in v0.23.0
List returns a new Iterator over the names of all stored keys. 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 (*Store) Set ¶ added in v0.23.0
Set stores the given key at the Fortanix SDKMS if and only if no entry with the given name exists.
If no such entry exists, Create returns kes.ErrKeyExists.