Skip to Content.
Sympa Menu

mace-opensaml-users - RE: signing a SAML response - C++

Subject: OpenSAML user discussion

List archive

RE: signing a SAML response - C++


Chronological Thread 
  • From: "Scott Cantor" <>
  • To: <>
  • Subject: RE: signing a SAML response - C++
  • Date: Thu, 3 Jan 2008 14:24:30 -0500
  • Organization: The Ohio State University

> xmlStr = XMLString::transcode(URI_ID_SHA1);
> reference->setDigestAlgorithm(xmlStr);
> XMLString::release(&xmlStr);

That's what's causing the error, the API is designed to use the DSIGConstant
members, which are static. I don't like copying data if I don't have to, and
these should always be constants anyway. It would work for at least one
signature operation if you waited to free the string, or used my
auto_ptr_XMLCh class to do the transcoding and freeing, but not if you free
the string after setting it.

In my case, I have configuration layers that supply me a const XMLCh*
version of whatever the user configures the hash to be, so I don't use the
DSIGConstant, but it's still a constant from the code's point of view.

> And none of my code explicitly sets the KeyName. Was that obtained from
the
> key.pem file?

It's derived from your certificate's CN. If you don't want it to, or need
other names, there are ways to change it (I think, I'd have to look).
Setting KeyInfo manually into the signature is definitely one way.

-- Scott





Archive powered by MHonArc 2.6.16.

Top of Page