I'll try and post a sample patch tomorrow and get your feedback. I was
thinking something along the lines of...
public interface IEncryptionService
{
     EncryptedValue IEncryptionService.Encrypt(string value);
     string IEncryptionService.Decrypt(EncryptedValue encryptedValue);
}

public class EncryptedValue
{
     public string EncryptedBase64Value {get; set;}
     public string Base64Iv {get; set;}
}

Additionally, if your question was aimed towards whether or not a message
should be entirely encrypted, that was what I was aiming for next. Currently
there is an opportunity to provide a IValueConvertor<T>, or your own
serializer. I was thinking it might be nice for something that registered
with the container like... Not sure on the name though.

public interface ICustomElementSerializer
{
     bool ShouldSerialize(Type type);
     XElement ToElement(object val, Func<Type, XNamespace> getNamespace);
     object FromElement(XElement element);
}

This way a single serializer could handle multiple message types. The
encryption could be handled either through convention, interface, or your
least favorite I'm assuming attributes. I can think of other things for us
that this would be useful for. One of our teams have expressed wanting to
re-use some of our existing message types that were used for WCF. This might
be a nice hook for them to use the DataContractSerializer if necessary.

That's as far as I've thought it through, feel free to comment. I'll try to
get a patch in tomorrow.

-Corey

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Rhino Tools Dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rhino-tools-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to