CryptXML CryptXmlOpenToEncode returns E_INVALIDARG for namespace element

0

This CryptXML sample code works when running:

CryptXML.exe -n Contoso SIGN FileOut.xml FileIn.xml /samlpEnvelope #

where FileIn.xml is defined as

<samlpEnvelope xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
  <Data>
    Hello, World!
  </Data>
</samlpEnvelope>

However, running this with the colon ":" namespace added

CryptXML.exe -n Contoso SIGN FileOut.xml FileIn.xml /samlp:Envelope #

<samlp:Envelope xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
  <Data>
    Hello, World!
  </Data>
</samlp:Envelope>

produces this error in CryptXmlOpenToEncode():

ERROR: 0x80070057 (E_INVALIDARG)

Anyone know how-to get CryptXML to understand the colon in the element name?

Thanks!

xml
signing
asked on Stack Overflow Jun 6, 2018 by vengy

1 Answer

0

A colleague programmer suggested this and it works!

CryptXML.exe -n Contoso SIGN FileOut.xml FileIn.xml /Envelope #

answered on Stack Overflow Jun 6, 2018 by vengy

User contributions licensed under CC BY-SA 3.0