XML Encryption - .Net Interop with Apache Santuario

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
The problem is simple.
Xml encrypted with Appache Santuario(Java) must make use of a specific Namespaces and Prefixes which .Net Decryption does not recognise and .Net Xml Encryption produces XML without the specified Namespaces and Prefixes which Appache Santurio
does not recognise and thus does not decrypt. see XML below.
I need to send the .Net Generated XML to a Server Formatted in the Appache Santurio format and convert the files I receive from the Server which are in Appache Santurio Format to the .Net Xml Encryption Format. Does anyone know of a nice way
to do this?
Appache Santurio:
<xenc:EncryptedData xmlns:xenc=" http://www.w3.org/2001/04/xmlenc http://www.w3.org/2001/04/xmlenc #" Type=" http://www.w3.org/2001/04/xmlenc#Element http://www.w3.org/2001/04/xmlenc#Element <br/>
<xenc:EncryptionMethod Algorithm=" http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/ http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/ ><br/>
<ds:KeyInfo xmlns:ds=" http://www.w3.org/2000/09/xmldsig http://www.w3.org/2000/09/xmldsig # <br/>
<xenc:EncryptedKey xmlns:xenc=" http://www.w3.org/2001/04/xmlenc http://www.w3.org/2001/04/xmlenc # <br/>
<xenc:EncryptionMethod Algorithm=" http://www.w3.org/2001/04/xmlenc#rsa-1_5"/ http://www.w3.org/2001/04/xmlenc#rsa-1_5"/ ><br/>
<ds:KeyInfo><br/>
<ds:KeyName>EDUPAC</ds:KeyName><br/>
</ds:KeyInfo><br/>
<xenc:CipherData><xenc:CipherValue>iNbKL+X0lH3xFAfSWTdgjYa3BKCydLJg93yket/pyHTpjqVf3iSAF0U7UGbVwZrskS1lZIfEIRtc<br/>
hoHjz2cleUX643FV21H2iDGa17mlutm7eOuWMpLvwPOW88FKwRz5iAUXmk+h2Tkhoryg+VP4pPCv<br/>
qYE8CB0Hg010mSImEyo=</xenc:CipherValue><br/>
</xenc:CipherData><br/>
</xenc:EncryptedKey><br/>
</ds:KeyInfo><br/>
<xenc:CipherData><br/>
<xenc:CipherValue>+tbDacvUwbO4Fk5yJ7e7kua6Go7/r9++n85sOrnaQcRmAw0gi5jawgW2P82JENCykqB/SwTT3Dc=</xenc:CipherValue><br/>
</xenc:CipherData><br/>
</xenc:EncryptedData>
.Net Xml Encryption Produces:
<EncryptedData xmlns=" http://www.w3.org/2001/04/xmlenc http://www.w3.org/2001/04/xmlenc #" Type=" http://www.w3.org/2001/04/xmlenc#Element http://www.w3.org/2001/04/xmlenc#Element <br/>
<EncryptionMethod Algorithm=" http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/ http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/ ><br/>
<KeyInfo xmlns=" http://www.w3.org/2000/09/xmldsig http://www.w3.org/2000/09/xmldsig # <br/>
<EncryptedKey xmlns=" http://www.w3.org/2001/04/xmlenc http://www.w3.org/2001/04/xmlenc # <br/>
<EncryptionMethod Algorithm=" http://www.w3.org/2001/04/xmlenc#rsa-1_5"/ http://www.w3.org/2001/04/xmlenc#rsa-1_5"/ ><br/>
<KeyInfo xmlns=" http://www.w3.org/2000/09/xmldsig http://www.w3.org/2000/09/xmldsig # <br/>
<KeyName>EDUPAC</KeyName><br/>
</KeyInfo><br/>
<CipherData><br/>
<CipherValue>TYfhXukvUICZezmCvyKPn1ggnJjEhdXKGWftMyewwX7aM8fbiBIahudgfyrQuk2KvqmD7HdFOi0o<br/>
jf9/4M0sUN7Xug8pf5DtTJpMD5ZX8R2M1PBSe7wA12U6l1FpKSrfzaaxIX2tOknLm9Fr+1ivffKL<br/>
6q+rIvemQn/vkLIjC+w=</CipherValue><br/>
</CipherData><br/>
</EncryptedKey><br/>
</KeyInfo><br/>
<CipherData><br/>
<CipherValue>6GtVt51HkymI/R7NbyGcsCe5160fCpIktkI2+spAzL8a1BV0f8l5CIYUMMLrdEYuEn5C+XcHIjY=</CipherValue><br/>
</CipherData><br/>
</EncryptedData>



View the full article
 
Back
Top