Documentation ¶
Index ¶
- Constants
- Variables
- func Decrypt(input string, password string) (string, error)
- func DecryptFile(path string, password string) (string, error)
- func Encrypt(input string, password string, pad int) (string, error)
- func EncryptFile(path string, input string, password string) error
- func GetKey(keyChoice Key, envPrefix string) (string, error)
- func GetKeyFromFile(fileName string, run bool) (string, error)
- func MaybeEncrypted(input string) bool
- type Key
- type KeyChoice
Constants ¶
View Source
const (
DefaultFileMode = 0666
)
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") ErrKeyFileNotExec = errors.New("key file is not executable") ErrKeyFileNotFound = errors.New("key file not found") )
Functions ¶
func DecryptFile ¶
DecryptFile decrypts the content of the file with the vault password
func EncryptFile ¶
EncryptFile encrypts the input string and saves it into the file
func GetKeyFromFile ¶
obtain a key from a file, if run is true the file will be executed
func MaybeEncrypted ¶
Return true if the input maybe encrypted as an ansible vault
Types ¶
Click to show internal directories.
Click to hide internal directories.