Documentation ¶
Index ¶
- func Decrypt(opts *DecryptOptions) (result string, err error)
- func DecryptFile(opts *DecryptFileOptions) (result string, err error)
- func Encrypt(opts *EncryptOptions) (result string, err error)
- func EncryptFile(opts *EncryptFileOptions) (result string, err error)
- func GenerateRandomBytes(n int) ([]byte, error)
- type DecryptFileOptions
- type DecryptOptions
- type EncryptFileOptions
- type EncryptOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decrypt ¶
func Decrypt(opts *DecryptOptions) (result string, err error)
Decrypt a string containing the ansible vault
func DecryptFile ¶
func DecryptFile(opts *DecryptFileOptions) (result string, err error)
DecryptFile reads content of filename, decrypts it and returns string
func Encrypt ¶
func Encrypt(opts *EncryptOptions) (result string, err error)
Encrypt will vault encrypt a piece of data.
If EncryptOptions.VaultID is set, it will upversion to 1.2, otherwise it will default to using 1.1.
EncryptOptions.VaultID must not include `;`. If it does, an error will be thrown.
func EncryptFile ¶
func EncryptFile(opts *EncryptFileOptions) (result string, err error)
EncryptFile reads content of filename provided and returns encrypted string
func GenerateRandomBytes ¶
GenerateRandomBytes will generate n length bytes using rand.Read
Types ¶
type DecryptFileOptions ¶
DecryptFileOptions is the interface used to pass data to the DecryptFile method
type DecryptOptions ¶
DecryptOptions is the interface used to pass data to the Decrypt method
type EncryptFileOptions ¶
EncryptFileOptions is the interface used to pass data to the EncryptFile method
type EncryptOptions ¶
EncryptOptions is the interface used to pass data to the Encrypt method