Documentation ¶
Index ¶
- type AesCtrEncryptor
- type GitCrypt
- func (g *GitCrypt) DecryptRepoKey(keyring openpgp.EntityList, keyName string, keyVersion uint32, ...) (Key, error)
- func (g *GitCrypt) DecryptRepoKeys(keyring openpgp.EntityList, keyVersion uint32, secretKeys []string, ...) ([]Key, error)
- func (g *GitCrypt) DecryptStream(keyFile Key, header []byte, in io.ReadSeeker, out io.Writer) error
- func (g *GitCrypt) GpgDecryptFromFile(keyring openpgp.EntityList, path string) ([]byte, error)
- func (g *GitCrypt) IsGitCrypted(fn string) bool
- func (g *GitCrypt) KeyFromFile(filename string) (Key, error)
- func (g *GitCrypt) ReadFileHeader(fp io.ReadSeekCloser) ([]byte, error)
- func (g *GitCrypt) ReadFileHeaderFromFile(filename string) ([]byte, error)
- type HMac
- type Key
- type KeyEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AesCtrEncryptor ¶
type AesCtrEncryptor struct { // Debug represents whether debug logging is turned on or not Debug bool // contains filtered or unexported fields }
AesCtrEncryptor represents an AES encryptor/decryptor
func NewAesCtrEncryptor ¶
func NewAesCtrEncryptor(rawKey []byte, nonce []byte) AesCtrEncryptor
NewAesCtrEncryptor creates a new AesCtrEncryptor instance with a key and nonce
type GitCrypt ¶
type GitCrypt struct { // Debug represents whether debug output will be enabled. Do not turn // this on until you really mean it. Debug bool // Vfs represents an optional virtual filesystem. If it is nil, the // standard OS file opening functions will be used. Vfs vfs.FileSystem }
GitCrypt is the namespace
func (*GitCrypt) DecryptRepoKey ¶
func (g *GitCrypt) DecryptRepoKey(keyring openpgp.EntityList, keyName string, keyVersion uint32, secretKeys []string, keysPath string) (Key, error)
DecryptRepoKey decrypts a repository key, given:
- keyring: A GPG keyring to use for the decryption.
- keyName: Name of the key set being used. Empty defaults to "default".
- keyVersion: Version of the git-crypt keys.
- secretKeys: Array of private keys to attempt to decrypt
- keysPath: Root path to the repository key directory (should be $REPOPATH/.git-crypt/keys)
func (*GitCrypt) DecryptRepoKeys ¶
func (g *GitCrypt) DecryptRepoKeys(keyring openpgp.EntityList, keyVersion uint32, secretKeys []string, keysPath string) ([]Key, error)
DecryptRepoKeys decrypts all available repository keys, given a GPG key
func (*GitCrypt) DecryptStream ¶
DecryptStream decrypts a stream of encrypted git-crypt format data given a key file and header
func (*GitCrypt) GpgDecryptFromFile ¶
GpgDecryptFromFile decrypts a file using a PGP/GPG key
func (*GitCrypt) IsGitCrypted ¶
IsGitCrypted returns whether or not a file has been encrypted in the git-crypt encryption format. Supports optional Vfs methods.
func (*GitCrypt) KeyFromFile ¶
KeyFromFile instantiates a new key from a specified file
func (*GitCrypt) ReadFileHeader ¶
func (g *GitCrypt) ReadFileHeader(fp io.ReadSeekCloser) ([]byte, error)
ReadFileHeader fetches the git-crypt file header from an open seekable file
type HMac ¶
type HMac struct {
// contains filtered or unexported fields
}
HMac represents an HMAC encryptor/decryptor
type Key ¶
Key is a git-crypt key structure
func (*Key) LoadFromFile ¶
LoadFromFile loads a key from a filesystem file