は、あなた自身のモデルバインダー
public class DecObjModelBinder : IModelBinder
{
public object BindModel(ControllerContext controllerContext,
ModelBindingContext bindingContext)
{
//make a instance of your object
var myObj = new DecObj()
//bind the properties from my obj
myObj.Title= bindingContext
.ValueProvider
.GetValue("Title") // The Property name sent from the browser
.ToString();
/* then the property you want to decrypt */
var encBody = bindingContext
.ValueProvider
.GetValue("EncBody") // The Property name sent from the browser
.ToString();
/* decryption logic here to the encBody then after assign the decrypted value to myObj*/
return myObj;
}
実装することができ、その後、あなたは経由のApplication_StartでGlobal.asxでModelBinder
を登録する:あなたはMessageHandlerのでこれを行うことができるはずModelBinders.Binders.Add(typeof(DecObj), new DecObjModelBinder());
何らかの種類のレガシー機能を暗号化するのは、SSLがこの要件のためのより優れたテクニックなので、いくつかの種類のレガシー機能ですか? – saintedlama