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

Function TestMasterKey_EncryptIfNeeded

kms/keysource_test.go:283–292  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

281}
282
283func TestMasterKey_EncryptIfNeeded(t *testing.T) {
284 key := createTestMasterKey(testKMSARN)
285 assert.NoError(t, key.EncryptIfNeeded([]byte("data")))
286
287 encryptedKey := key.EncryptedKey
288 assert.NotEmpty(t, encryptedKey)
289
290 assert.NoError(t, key.EncryptIfNeeded([]byte("some other data")))
291 assert.Equal(t, encryptedKey, key.EncryptedKey)
292}
293
294func TestMasterKey_EncryptedDataKey(t *testing.T) {
295 key := &MasterKey{EncryptedKey: "some key"}

Callers

nothing calls this directly

Calls 2

createTestMasterKeyFunction · 0.85
EncryptIfNeededMethod · 0.65

Tested by

no test coverage detected