views:

673

answers:

2

I am developing a Remoting application where a client looks up store specific information to login to a web server. It sets the user name and passwords in a class that stores the properties as System.Security.SecureString. I then try to pass the class with the login credentials to a server object that uses it to connect to the web host, get and some information back. When I call the server method I this error:

Type 'System.Security.SecureString' in Assembly 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.
The class that contains the SecureStrings is marked as serializeable, and this was working while developing until I added the SecureString properties. Is there something I need to do to make this work, or am I going to have to change SecureString to String?

A: 

It is very difficult to get data from a SecureString, which is a good thing. If you want to use Securestring you'll have to implement a custom serializer on your object that can take the SecureString and save it as something usable (maybe even encrypting it in the process).

Talljoe
Don't like it, but changed all the SecureString to string and I'll just have to settle for the encryption provided by the channel
Beaner
A: 

Secure string class is not visible to COM.That`s why it is showing this error. May be converting secure string to string and then serializing it will help.

Anitesh