D
dfa_geko
Hi All,
I had a question about encrypting and decrypting XML files using asymmetric
keys. I copied some sample code from MSDN, here are the samples:
http://msdn2.microsoft.com/en-us/library/ms229746.aspx
http://msdn2.microsoft.com/en-us/library/ms229919.aspx
The samples I used are the ones near the bottom of the page. (With a slight
modification of moving edElement.KeyInfo.AddClause(new KeyInfoEncryptedKey
(ek)); to before edElement.CipherData.CipherValue = encryptedElement;
statement in the Encryption sample)
However, I have found that when I encrypt a file using those techniques and
passing the XML file to another machine, I can't decrypt it. I get a Bad
Data exception. However, when I encrypt/decrypt with the same user/login,
it works fine! I thought it was the machine at first but it turns out it
wasn't because my ASPNET user wasn't able to decrypt the XML file that I
created from a console app of my user on the same machine. It doesn't work
on different machines. Does anyone know why??? I'm very confused. Or maybe
I'm doing something wrong. I'm wondering if anyone can shed any light on
this.
Much Thanks!!!
dfa_geko
I had a question about encrypting and decrypting XML files using asymmetric
keys. I copied some sample code from MSDN, here are the samples:
http://msdn2.microsoft.com/en-us/library/ms229746.aspx
http://msdn2.microsoft.com/en-us/library/ms229919.aspx
The samples I used are the ones near the bottom of the page. (With a slight
modification of moving edElement.KeyInfo.AddClause(new KeyInfoEncryptedKey
(ek)); to before edElement.CipherData.CipherValue = encryptedElement;
statement in the Encryption sample)
However, I have found that when I encrypt a file using those techniques and
passing the XML file to another machine, I can't decrypt it. I get a Bad
Data exception. However, when I encrypt/decrypt with the same user/login,
it works fine! I thought it was the machine at first but it turns out it
wasn't because my ASPNET user wasn't able to decrypt the XML file that I
created from a console app of my user on the same machine. It doesn't work
on different machines. Does anyone know why??? I'm very confused. Or maybe
I'm doing something wrong. I'm wondering if anyone can shed any light on
this.
Much Thanks!!!
dfa_geko