vault

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package vault GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidCipherData = errors.New("invalid cipher data")
)

Functions

func NewCipherStream

func NewCipherStream(alg string, key []byte, asDecrypt bool) (cryptocipher.Stream, error)

Types

type Cipher

type Cipher interface {
	Encrypt(ctx context.Context, data []byte, opts ...OptCipher) ([]byte, error)
	Decrypt(ctx context.Context, data []byte) ([]byte, error)
}

func NewCipher

func NewCipher(key []byte) Cipher

type CipherData

type CipherData struct {
	CipherOpt
	bytes.Buffer
}

func ParseCipherData

func ParseCipherData(data []byte) (*CipherData, error)

func (CipherData) DataType

func (CipherData) DataType(driver string) string

func (*CipherData) EncodedBytes

func (cd *CipherData) EncodedBytes() []byte

func (CipherData) RuntimeDoc

func (v CipherData) RuntimeDoc(names ...string) ([]string, bool)

func (*CipherData) Scan

func (cd *CipherData) Scan(src interface{}) error

func (CipherData) Value

func (cd CipherData) Value() (driver.Value, error)

type CipherOpt

type CipherOpt struct {
	Alg string `json:"alg"`
}

func (CipherOpt) RuntimeDoc

func (v CipherOpt) RuntimeDoc(names ...string) ([]string, bool)

type OptCipher

type OptCipher = func(c *CipherOpt)

func WithAlg

func WithAlg(alg string) OptCipher

type Seed

type Seed struct {
	Password []byte
	Salt     []byte
	Count    int
}

func NewSeed

func NewSeed(password []byte, salt []byte, count int) *Seed

func (Seed) RuntimeDoc

func (v Seed) RuntimeDoc(names ...string) ([]string, bool)

func (*Seed) ToCipher

func (s *Seed) ToCipher() Cipher

Jump to

Keyboard shortcuts

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