vault

package
v8.5.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2019 License: MIT Imports: 18 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(s string) string

func Encode

func Encode(s string, n int) string

func Stream

func Stream(enctype string, key, iv []byte) (cipher.Stream, cipher.Stream, error)

func WriteCrypt

func WriteCrypt(path, master string, creds *Credentials) error

Types

type Client

type Client struct {
	URL   string
	Token string
	HTTP  *http.Client
}

func Connect

func Connect(url, cacert string) (*Client, error)

func (*Client) Delete

func (c *Client) Delete(path string) error

func (*Client) Do

func (c *Client) Do(method, url string, data interface{}) (*http.Response, error)

func (*Client) Get

func (c *Client) Get(path string, out interface{}) (bool, error)

func (*Client) Initialize

func (c *Client) Initialize(crypt, master string) (string, error)

func (*Client) Initialized

func (c *Client) Initialized() (bool, error)

func (*Client) NewParameters

func (c *Client) NewParameters(id, typ string, fixed bool) (Parameters, error)

func (*Client) Post

func (c *Client) Post(path string, in, out interface{}) error

func (*Client) Put

func (c *Client) Put(path string, in, out interface{}) error

func (*Client) Rekey

func (c *Client) Rekey(path, current, proposed string, rotate bool) (string, error)

func (*Client) Retrieve

func (c *Client) Retrieve(id string) (Parameters, error)

func (*Client) RetrieveFixed

func (c *Client) RetrieveFixed() (Parameters, error)

func (*Client) Seal

func (c *Client) Seal() error

func (*Client) Sealed

func (c *Client) Sealed() (bool, error)

func (*Client) Status

func (vault *Client) Status() (string, error)

func (*Client) Store

func (c *Client) Store(id string, params Parameters) error

func (*Client) StoreFixed

func (c *Client) StoreFixed(p Parameters) error

func (*Client) Unseal

func (c *Client) Unseal(crypt, master string) error

type Credentials

type Credentials struct {
	SealKey   string `json:"seal_key"`
	RootToken string `json:"root_token"`
}

func ReadCrypt

func ReadCrypt(path, master string) (*Credentials, error)

type Parameters

type Parameters struct {
	Key  string `json:"key"`
	IV   string `json:"iv"`
	Type string `json:"type"`
	UUID string `json:"uuid"`
}

func DeriveFixedParameters

func DeriveFixedParameters(key []byte) (Parameters, error)

func GenerateFixedParameters

func GenerateFixedParameters() (string, Parameters, error)

func GenerateRandomParameters

func GenerateRandomParameters(typ string) (Parameters, error)

Jump to

Keyboard shortcuts

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