INNER CODE UNIT · Go
testEncryptDecryptKey
minio/kes · api_test.go:387
func testEncryptDecryptKey(t *testing.T) {
t.Parallel()
ctx := testContext(t)
srv, url := startServer(ctx, nil)
defer srv.Close()
plaintext := make([]byte, mem.KB)
associatedData := make([]byte, 80)
client := defaultClient(url)
for i, test := range validNameTests {
err := client.CreateKey(ctx, test.Name)
if err == nil && test.ShouldFail {
t.Errorf("Test %d: setup: creating key '%s' should have failed", i, test.Name)
}
if err != nil && !test.ShouldFail {
t.Errorf("Test %d: setup: failed to create key '%s': %v", i, test.Name, err)