readAndVerifyKeyMaterial attempts to read key material from the given provider and compares it against the expected key material.
(ctx context.Context, kmr kmReader, wantKM *KeyMaterial)
| 143 | // readAndVerifyKeyMaterial attempts to read key material from the given |
| 144 | // provider and compares it against the expected key material. |
| 145 | func readAndVerifyKeyMaterial(ctx context.Context, kmr kmReader, wantKM *KeyMaterial) error { |
| 146 | gotKM, err := kmr.KeyMaterial(ctx) |
| 147 | if err != nil { |
| 148 | return fmt.Errorf("KeyMaterial(ctx) failed: %w", err) |
| 149 | } |
| 150 | return compareKeyMaterial(gotKM, wantKM) |
| 151 | } |
| 152 | |
| 153 | func compareKeyMaterial(got, want *KeyMaterial) error { |
| 154 | if len(got.Certs) != len(want.Certs) { |
no test coverage detected