createSignedPKCS7 produces a base64-encoded PKCS7 SignedData envelope over content, signed by the chain's leaf certificate.
(t *testing.T, content []byte)
| 202 | // createSignedPKCS7 produces a base64-encoded PKCS7 SignedData |
| 203 | // envelope over content, signed by the chain's leaf certificate. |
| 204 | func (tc *testCertChain) createSignedPKCS7(t *testing.T, content []byte) string { |
| 205 | t.Helper() |
| 206 | |
| 207 | sd, err := pkcs7.NewSignedData(content) |
| 208 | require.NoError(t, err) |
| 209 | err = sd.AddSignerChain(tc.SigningCert, tc.SigningKey, []*x509.Certificate{tc.IntermediateCert}, pkcs7.SignerInfoConfig{}) |
| 210 | require.NoError(t, err) |
| 211 | der, err := sd.Finish() |
| 212 | require.NoError(t, err) |
| 213 | return base64.StdEncoding.EncodeToString(der) |
| 214 | } |
| 215 | |
| 216 | // validationOptions returns azureidentity.Options that trust only this |
| 217 | // chain's Root CA. |
no test coverage detected