LosFormatter

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The LosFormatter class has an overloaded constructor:

public LosFormatter(
bool enableMac,
string macKeyModifier
);

what is the macKeyModifier? I am currently passing null but I would like to
know what a valid value would be. Thanks.
 
Hi STech,

As for the second param of the LosFormatter 's following constructor:

public LosFormatter(
bool enableMac,
string macKeyModifier
);

, it is just a string which help the user to speicfy a machinekey value at
runtime. Generally, we specify the value in machine.config or web.config
file's <machineKey> element. Also , as I mentioned in another thread, we
can create custom keys programmicaly. Please refer to the following kb :

#How to create keys by using Visual C# .NET for use in Forms authentication
http://support.microsoft.com/default.aspx?scid=kb;en-us;312906

Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Hi Stech

Have you had a chance to check the things in my last reply or have you got
any further ideas on this issue?

If there 're anything else we can help, please feel free to post here.
Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
What concerns me is that the machinekey has an attribute set to
AutoGenerate. The Los Formatter using this key to compute the hash of the
viewstate. I am using the LosFormatter to write this viewstate information to
a file. If the machinekey changes at a latter stage, reading the viewstate
back will fail (?).

It would help me better if you explained the AutoGenerate attribute.

Thanking you.
 
Hi Stech,

Thanks for your followup. As for the "AutoGenerate" option, it means the
.net will automatically generate a key value for the <machinekey> element
via its internal algorithm. And there is also assign "IsolateApps" modifier
to the validationKey attribute so that the ASP.NET will provide a
idenitcal key for each asp.net web application. But since the key value is
generated by the framework internally, we can't get it. So if we want to
manually do viewstate encrypting via losformatter, we need to specify our
custom key value. Here is a msdn tech article which has mentioned custom
persistence of VIEWSTATE in asp.net:


#Understanding ASP.NET View State
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html
/viewstate.asp

Hope helps. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Hi Stech,

Have you had a chance to check the things in my last reply or have you got
any further ideas on this issue?
If there're anything else we can help, please feel free to post here.
Thanks.


Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top