| 1 | package kms |
| 2 | |
| 3 | import "testing" |
| 4 | |
| 5 | func TestClient_Decrypt(t *testing.T) { |
| 6 | encryptArgs := &EncryptAgrs{ |
| 7 | KeyId: TestKeyId, |
| 8 | EncryptionContext: encryptionContext, |
| 9 | Plaintext: "abc", |
| 10 | } |
| 11 | |
| 12 | encryptResponse, err := debugClient.Encrypt(encryptArgs) |
| 13 | if err != nil { |
| 14 | t.Fatalf("Error %++v", err) |
| 15 | } else { |
| 16 | t.Logf("Result = %++v", encryptResponse) |
| 17 | } |
| 18 | |
| 19 | args := &DecryptArgs{ |
| 20 | CiphertextBlob: encryptResponse.CiphertextBlob, |
| 21 | EncryptionContext: encryptionContext, |
| 22 | } |
| 23 | |
| 24 | response, err := debugClient.Decrypt(args) |
| 25 | if err != nil { |
| 26 | t.Fatalf("Error %++v", err) |
| 27 | } else { |
| 28 | t.Logf("Result = %++v", response) |
| 29 | } |
| 30 | |
| 31 | } |