Discover Packages
github.com/nasimstg/xenvsync
internal
vault
package
Version:
v1.13.0
Opens a new window with list of versions in this module.
Published: Apr 2, 2026
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package vault handles the on-disk format of .env.vault files.
Format:
The vault file stores the raw ciphertext as a base64-encoded string
wrapped with a header/footer for easy identification:
#/---xenvsync vault---/
<base64-encoded ciphertext>
#/---end xenvsync vault---/
The key is NEVER included in the vault output.
Decode extracts raw ciphertext bytes from a vault file.
Encode wraps raw ciphertext bytes into the vault file format.
EncodeV2 writes a V2 vault file with key slots and ciphertext.
IsV2 returns true if the data appears to be a V2 vault.
type KeySlot struct {
Name string `json:"name"`
EphemeralPub string `json:"ephemeral_pub"`
EncryptedKey string `json:"encrypted_key"`
}
KeySlot holds the encrypted symmetric key for one team member.
type V2Vault struct {
Slots []KeySlot
Ciphertext []byte
}
V2Vault represents a parsed V2 vault file.
DecodeV2 parses a V2 vault file into key slots and raw ciphertext.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.