The WIF code example given in this answer creates a signed SAML2 assertion.
The eventual xml has the following structure (I've chopped out all the values because they're not important to this question):
<Assertion>
<Issuer></Issuer>
<Signature>
<SignedInfo>
</SignedInfo>
<SignatureValue></SignatureValue>
<KeyInfo>
</KeyInfo>
</Signature>
<Subject>
<NameID></NameID>
<SubjectConfirmation/>
</Subject>
<Conditions/>
</Assertion>
But for a particular test scenario I need to create it without the <KeyInfo>
element.
Is this possible with the WIF Saml2Assertion class? I have to provide the SigningCredentials
but so far have not found a way to just sign but not include <KeyInfo>
(force the recipient to already have the cert).
assertion.SigningCredentials = clientSigningCredentials;
return new Saml2SecurityToken(assertion);
Again, silly test scenario but it's something I want to simulate because I think this is supported by the standard.