XMLTooling - Is it possible to not emit <ds:KeyInfo> in C++?

Cantor, Scott cantor.2 at osu.edu
Thu Nov 1 13:53:17 EDT 2012


On 11/1/12 1:11 PM, "Selhorst, Marcel" <Marcel.Selhorst at BDR.de> wrote:

>However, I can't find a solution for this in C++.
>Trying something like:
>
>	KeyInfo* foo = KeyInfoBuilder::buildKeyInfo();
>	mySignature->setKeyInfo(foo);
>or
>	mySignature->setKeyInfo(nullptr);
>
>always includes the aforementioned key information...
>Any clue how I can do this with C++?

Doing that would work except that it invalidates the DOM and so it has to
regenerate the DOM again to serialize it. The act of signing auto-adds
KeyInfo if and only if you set the signing key by way of passing a
Credential into the marshall() method.

If you set the signing key explicitly on the signature, then it should not
auto-add a KeyInfo. So you must be passing in a Credential to marshall() I
guess.

Secondly, there are properties one can manipulate on a Credential object
to control the KeyInfo. So it depends on how the credential object is
obtained. But they're not public API, it's something CredentialResolvers
can expose and then pass along when the create Credential objects. So if I
know how you're manufacturing the Credential I can probably advise on that
route.

With the existing plugin type=="File", there's a keyInfoMask property you
can set on the plugin creation DOM to control what types of info get set.

-- Scott




More information about the dev mailing list