Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptVault ¶
DecryptVault receives an io.Reader that contains an encrypted content and it's nonce at the start of it.
If the key is not 128, 192 or 256 bits long it will cause an error. If the data cannot be authenticated it will also return an error
Types ¶
type VaultReader ¶
type VaultReader struct { *sio.EncReader Nonce []byte // contains filtered or unexported fields }
VaultReader is amazing :D
but also implements io.Closer by deleting the underlying temporal clean file. It also stores the nonce if you need to use it later
It is important to close the vault in order to prevent the retrieval of the plain data from the temporal dir.
func NewVaultReader ¶
func NewVaultReader(files []string, key []byte) (*VaultReader, error)
NewVaultReader creates a new Vault reader by packaging the specified files and encrypted the archive with the specified key.
It will use AES 128, 192 or 256 depending on the length of the key. If a key of different length is provided, it will return an error.
It is important that you close this reader after you are done with it to delete any plain data that might be left
func (*VaultReader) Close ¶
func (v *VaultReader) Close() error
Close errases the underlying tempora file to prevent it's retrieval by an attacker and save disk space