secret

package
v0.0.0-...-b0e6734 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 10 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateAesSecretKey

func GenerateAesSecretKey() ([]byte, error)

func IsExtractDataError

func IsExtractDataError(err error) bool

func MergeEncodedYaml

func MergeEncodedYaml(oldData, newData, oldEncodedData, newEncodedData []byte) ([]byte, error)

func MergeEncodedYamlNode

func MergeEncodedYamlNode(oldConfig, newConfig, oldEncodedConfig, newEncodedConfig *yaml_v3.Node) (*yaml_v3.Node, error)

Types

type AesEncoder

type AesEncoder struct {
	CipherBlock cipher.Block
}

func NewAesEncoder

func NewAesEncoder(key []byte) (*AesEncoder, error)

func (*AesEncoder) Decrypt

func (s *AesEncoder) Decrypt(data []byte) ([]byte, error)

func (*AesEncoder) Encrypt

func (s *AesEncoder) Encrypt(data []byte) ([]byte, error)

type Encoder

type Encoder interface {
	Encrypt(data []byte) ([]byte, error)
	Decrypt(encodedData []byte) ([]byte, error)
}

type YamlEncoder

type YamlEncoder struct {
	Encoder Encoder
	// contains filtered or unexported fields
}

YamlEncoder is an Encoder compatible object with additional helpers to work with yaml data: EncryptYamlData and DecryptYamlData

func NewYamlEncoder

func NewYamlEncoder(encoder Encoder) *YamlEncoder

func (*YamlEncoder) Decrypt

func (s *YamlEncoder) Decrypt(data []byte) ([]byte, error)

func (*YamlEncoder) DecryptYamlData

func (s *YamlEncoder) DecryptYamlData(data []byte) ([]byte, error)

func (*YamlEncoder) Encrypt

func (s *YamlEncoder) Encrypt(data []byte) ([]byte, error)

func (*YamlEncoder) EncryptYamlData

func (s *YamlEncoder) EncryptYamlData(data []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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