vault

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultFileMode = 0666
)
View Source
const VaultHeader = "$ANSIBLE_VAULT;1.1;AES256"

Variables

View Source
var (
	// ErrEmptyPassword is returned when password is empty
	ErrEmptyPassword = errors.New("password is blank")

	// ErrInvalidFormat is returned when secret content is not valid
	ErrInvalidFormat = errors.New("invalid secret format")

	// ErrInvalidPadding is returned when invalid key is used
	ErrInvalidPadding = errors.New("invalid padding")
)

Functions

func Decrypt

func Decrypt(input string, password string) (string, error)

Decrypt decrypts the input string with the vault password

func DecryptFile

func DecryptFile(path string, password string) (string, error)

DecryptFile decrypts the content of the file with the vault password

func Encrypt

func Encrypt(input string, password string, pad int) (string, error)

Encrypt encrypts the input string with the vault password

func EncryptFile

func EncryptFile(path string, input string, password string) error

EncryptFile encrypts the input string and saves it into the file

func MaybeEncrypted

func MaybeEncrypted(input string) bool

Return true if the input maybe encrypted as an ansible vault

Types

This section is empty.

Jump to

Keyboard shortcuts

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