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

Method Encrypt

sops_test.go:44–50  ·  view source on GitHub ↗
(value interface{}, key []byte, path string)

Source from the content-addressed store, hash-verified

42type encPrefixCipher struct{}
43
44func (c encPrefixCipher) Encrypt(value interface{}, key []byte, path string) (string, error) {
45 b, err := ToBytes(value)
46 if err != nil {
47 return "", err
48 }
49 return "ENC:" + string(b), nil
50}
51func (c encPrefixCipher) Decrypt(value string, key []byte, path string) (plaintext interface{}, err error) {
52 v, ok := strings.CutPrefix(value, "ENC:")
53 if !ok {

Callers

nothing calls this directly

Calls 1

ToBytesFunction · 0.85

Tested by

no test coverage detected