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

Interface Cipher

sops.go:103–110  ·  view source on GitHub ↗

Cipher provides a way to encrypt and decrypt the data key used to encrypt and decrypt sops files, so that the data key can be stored alongside the encrypted content. A Cipher must be able to decrypt the values it encrypts.

Source from the content-addressed store, hash-verified

101// Cipher provides a way to encrypt and decrypt the data key used to encrypt and decrypt sops files, so that the
102// data key can be stored alongside the encrypted content. A Cipher must be able to decrypt the values it encrypts.
103type Cipher interface {
104 // Encrypt takes a plaintext, a key and additional data and returns the plaintext encrypted with the key, using the
105 // additional data for authentication
106 Encrypt(plaintext interface{}, key []byte, additionalData string) (ciphertext string, err error)
107 // Encrypt takes a ciphertext, a key and additional data and returns the ciphertext encrypted with the key, using
108 // the additional data for authentication
109 Decrypt(ciphertext string, key []byte, additionalData string) (plaintext interface{}, err error)
110}
111
112// Comment represents a comment in the sops tree for the file formats that actually support them.
113type Comment struct {

Callers 16

EncryptMethod · 0.65
encryptWithOpenPGPMethod · 0.65
TestMasterKey_EncryptFunction · 0.65
TestPGPFunction · 0.65
EncryptContextMethod · 0.65
EncryptTreeFunction · 0.65
DataWithFormatFunction · 0.95
DecryptMethod · 0.65
decryptKeyFunction · 0.65
passphrasePromptMethod · 0.65

Implementers 15

reverseCiphersops_test.go
encPrefixCiphersops_test.go
MockCiphersops_test.go
Treesops.go
MasterKeyhckms/keysource.go
MasterKeypgp/keysource.go
MasterKeygcpkms/keysource.go
mockKeyManagementServergcpkms/mock_kms_server_test.go
MasterKeykms/keysource.go
Serverkeyservice/server.go
keyServiceClientkeyservice/keyservice_grpc.pb.go
UnimplementedKeyServiceServerkeyservice/keyservice_grpc.pb.go

Calls

no outgoing calls

Tested by

no test coverage detected