cryptoyaml

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package cryptoyaml provides a simple encryption and decryption for YAML function.

Index

Constants

This section is empty.

Variables

View Source
var ErrTooShort = errors.New("data is too short")

ErrTooShort indicates the provided data is too short to be valid.

Functions

func Decrypt

func Decrypt(rnd io.Reader, r Decoder, w Encoder, priv *rsa.PrivateKey) error

Decrypt decode every strings from base64 and decrypts them in a YAML.

func Encrypt

func Encrypt(rnd io.Reader, r Decoder, w Encoder, pub *rsa.PublicKey) error

Encrypt encrypts every strings in a Encrypt and encode them to base64.

Types

type Decoder

type Decoder interface {
	// Decode reads the YAML from the reader and unmarshals it into v.
	Decode(v interface{}) (err error)
}

Decoder decodes a YAML file.

type Encoder

type Encoder interface {
	// Encode writes the YAML representation of v to the writer.
	Encode(v interface{}) (err error)
}

Encoder encodes a YAML file.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳