MCPcopy
hub / github.com/getsops/sops / decryptTree

Function decryptTree

cmd/sops/decrypt.go:29–54  ·  view source on GitHub ↗
(opts decryptOpts)

Source from the content-addressed store, hash-verified

27}
28
29func decryptTree(opts decryptOpts) (tree *sops.Tree, err error) {
30 tree, err = common.LoadEncryptedFileWithBugFixes(common.GenericDecryptOpts{
31 Cipher: opts.Cipher,
32 InputStore: opts.InputStore,
33 InputPath: opts.InputPath,
34 ReadFromStdin: opts.ReadFromStdin,
35 IgnoreMAC: opts.IgnoreMAC,
36 KeyServices: opts.KeyServices,
37 })
38 if err != nil {
39 return nil, err
40 }
41
42 _, err = common.DecryptTree(common.DecryptTreeOpts{
43 Cipher: opts.Cipher,
44 IgnoreMac: opts.IgnoreMAC,
45 Tree: tree,
46 KeyServices: opts.KeyServices,
47 DecryptionOrder: opts.DecryptionOrder,
48 })
49 if err != nil {
50 return nil, err
51 }
52
53 return tree, nil
54}
55
56func decrypt(opts decryptOpts) (decryptedFile []byte, err error) {
57 tree, err := decryptTree(opts)

Callers 2

decryptFunction · 0.85
mainFunction · 0.85

Calls 2

DecryptTreeFunction · 0.92

Tested by

no test coverage detected