Documentation ¶
Index ¶
- type Client
- func (c *Client) Key(ctx context.Context, namespace, key string) (*signer.VaultKey, error)
- func (c *Client) Keys(ctx context.Context, namespace string) ([]*signer.VaultKey, error)
- func (c *Client) NamespaceKeys(ctx context.Context, namespace string) ([]string, error)
- func (c *Client) Namespaces(ctx context.Context) ([]string, error)
- func (c *Client) Sign(data []byte) ([]byte, error)
- func (c *Client) WithKey(namespace, key string) signer.Vault
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Key ¶
Key fetches a key with the given namespace and name from the Vault.
Key namespace correspond 1:1 with a Vault transit engine path.
func (*Client) Keys ¶
Keys fetches all keys from a given namespace. As the Vault doesn't support retrieving all keys at once, the function first takes all key names, and then fetches key information for every returned key name.
Keys namespace correspond 1:1 with a Vault transit engine path.
func (*Client) NamespaceKeys ¶
NamespaceKeys returns the names of the keys in a given namespace (vault transit engine).
func (*Client) Namespaces ¶
Namespaces returns the names of available transit engines in the Vault.
Note: only Vault transit engine names are returned.
func (*Client) Sign ¶
Sign calls the Vault transit API to produce a signature on the given data. The key that will be used for signing is determined by the signkey attribute of the Client. If you want to sign with a different key, you should call client.WithKey before making the Sign. For example:
client := vault.WithKey("transit", "key1") client.Sign(...)