Skip to Content.
Sympa Menu

mace-opensaml-users - [OpenSAML]

Subject: OpenSAML user discussion

List archive

[OpenSAML]


Chronological Thread 
  • From: Chris Card <>
  • To: <>
  • Subject: [OpenSAML]
  • Date: Wed, 11 Aug 2010 14:35:06 +0000
  • Importance: Normal

I'm trying to write code to generate SAML 2.0 metadata xml.

If I've loaded a certificate using SecurityHelper::loadCertificatesFromFile(), and got an XSECCryptoX509*, how can I convert it into an xmlsignature::X509Certificate object?

I tried using SecurityHelper::getDEREncoding() on the XSECCryptoX509 object, and passing the result to xmlsignature::X509Certificate::setValue() but that didn't give the result I was expecting:

I get
<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" validUntil="2011-08-11T13:56:15Z">
  <md:SPSSODescriptor AuthnRequestsSigned="1" WantAssertionsSigned="1">
    <md:KeyDescriptor use="signing">
      <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
        <ds:X509Data>
          <ds:X509Certificate>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDD9QXYuvjnfSA7CmsiOtcYtcytMy1+ihkbZTN6MmHKa//wQTVGBLD3qH7t5IYbVxBkkYoFFGiJwTLUgLpzwXkSiN46sQUpJCgoddyQc3uT2ATMydeXIJpiNp6Ur8DcW/yi4chy+Hmbk9bkr39MHGWjqCoHj+9g217HHUpt+zcZhwIDAQAB</ds:X509Certificate>
        </ds:X509Data>
      </ds:KeyInfo>
    </md:KeyDescriptor>
....

whereas I expect to get the base64-encoded certificate to start

MIICETCCAXoCCQD6/8r88WaAkDANBgkqhkiG9w0BAQUFADBNMQswCQYDVQQGEwJVSzEVMBMGA1UEBwwMRGVm......

Chris



Archive powered by MHonArc 2.6.16.

Top of Page