Category Archives: dotNET

Why I need to learn WSE2

(Links to former posts that I refer to in this post: 1, 2, 3)

Hey, I ain’t no plumber. I think by now anyone who reads my blog is well aware of this.

Yet, I needed to act like one last month when I had to use WSE1.0 to encrypt some super secret data that was being sent out from a web service. I followed some samples because I didn’t *really* understand what I was doing and achieved my goal. WSE2 is not quite available for production which is why I had to use WSE1.0.

Now I am looking at WSE2 and trying to understand what’s new and improved about it.

One new thing is security. So I needed to go back to my original solution and dissect it and TRULY understand it so taht I could compare it to what I was about to learn in the new WSE.

Here is how to encrypt data in WSE1.0. Better take a very comfortable seat. This is not code, but an explanation. Don’t worry about memorizing this stuff, because my point is how complicated it is.

I encrypted the data using symmetric key encryption. Very complicated and for the most part followed some samples that I found. (see my previous posts for those references). It is all done through HTTPFiltering. If you haven’t used HTTPFiltering, what it does is grab a web call or a web response when it’s on it’s way by, and do something to it first then send it on it’s way. For example you can create a filter that says, “if you see a response going by, grab it and make everything upper case”. (This is probably close enough though not a technically perfect explanation.)

First you have to create an object that helps better introduce your web response to the HTTPFilter. It is a SoapContext — and in constructing this object you will define it as a ResponseContext. You are going to be attaching this soapcontext to your web service response and then it will get read by the HTTPFilter.

The super secret keys (byte arrays that you make up) are hard coded into the client code and into the web service. There are two keys, the key and something called an initial vector key which is also a byte array.

Then you create an algorithm class and attach those byte arrays to it through a “key” and an “IV” property. I happen to be using the cryptography class for doing TripleDES Encryption. There are others and they may not use keys in this way. I did not choose this type of encryption for any educated reason other than this is what the samples I was using leveraged.

Then you create an encryption key object that is based on this algorithm object.

Then you need to name this key object with a URI.

Then you take a deep breath. 🙂

Now you take the whole key that you just created and use it to construct a WSE object called an EncryptionData “element”.

Lastly, you add this new element to the collection of security elements that are part of the soapContext object that you created at the beginning.

Once this is all done, what happens is as the soap response is on it’s way out of the web server, it hits the httpfilter, the filter reads the context that was attached and inside of the context is an instruction to encrypt the soap response using the keys that you created.

Then there’s the client. Find, download and install the WSE Settings Tool.

Then, the biggest PIA. You need to manually modify the proxy class that is created when you make a reference in your project to the webservice. If you modify the webservice and update the reference you have to remember to first force your proxy to show the new code (right click on the reference file and run “custom tool”  that you get when you install the wse settings tool). Then you will see that the proxy changed back to the original reference which needs to be changed. (I’m not going into details, again, just explaining the drudgery).

In your client code, you need to create a decryption class and hard code your two super secret byte arrays and create a decryption object. When the soap message is returned from the web service, the proxy will recognize the soapcontext and go find your decrypting class and decrypt the data.

Now you see why a) not many people were using this and b) Microsoft needed to re-write this stuff!

Drew Robbins gets a Tech Blogging Home

Drew Robbins, known to many as the creator of TechEdBloggers and PDCBloggers has always had one of the most beautiful blog sites at www.drewby.net with a lot of information on his wife’s native county, Japan where he has travelled often. Drew has been blogging a lot longer than most of us. He has just created a second blog home for himself at http://geekswithblogs.net/drewby/ where I believe he will be focusing his more technical posts.

Awesome looking webcast series to bring VB6ers into the .NET fold

Are you or do you know a VB6 programmer who is still worried about the leap, learning curve, etc. to .NET? To me the most daunting thing was not wanting to just do things the VB6 way when I moved to .NET. I didn’t want to be just another mort. Well this looks like a REALLY promising series of webcasts that takes VB6 devs by the hand and shows them the real meat of .NET. Quoting Duncan MacKenzie

A series of 15 webcasts & lab exercises for the VB6 programmer… (see the full list here)

MSDN Webcast: Program Execution in the 21st Century – Level 200
2/3/2004 1:00 PM – 2/3/2004 2:30 PM Live Meeting Webcast

This is the first webcast in the 15 part series “Modern Software Development in .NET Using Visual Basic”.

Developers shouldn’t miss this opportunity to examine the following topics with renowned author Joe Hummel, PhD: Virtual machines, sandboxes, garbage collection; Class libraries; Execution in .NET: CLR, FCL, JIT compilation, GAC; Quick discussion of application designs: monolithic vs. component-based

Presenter: Joe Hummel, PhD. DevelopMentor instructor and course author, DevelopMentor

I will be making sure that not only everyone in my user group knows about this, but I will use my INETA connection to get this out to all user group leaders around the world.

 

Typed Datasets and Molasses

I have used typed datasets in a few cases where I have to build a dataset from xml data or something along those lines. Most of the things I didn’t like about them expressed nicely by Shawn Wildermuth, (THE ADO Guy) and Rick Strahl here and here, I just dealt with because I wasn’t using them extensively throughout my apps, but just to solve a few specific problems. However, I now have an issue with datasets that I don’t want to put up with – instantiating a new object based on a typed dataset. WTF – it takes for freakin’ ever!

OK I feel better now.

The Disappearing Form Designer

Every once in a while, while working on a windows app in VS.NET2003, I lose the design view of a particular form. The solution Explorer only displays it as a class and there is no way to access the design view of the form. The components all still exist in the code. It’s a little bit of a heart stopper. But then removing and then readding the project from the solution brings back the form. ‘Sup with that?

A .NET Poem

I have been looking at the BCL a lot lately in preparation for a presentation on What’s new in the Base Class Library for Whidbey that I am doing at EdgeEast and at DevTeach.

Ever since K.C. pointed to this brilliant visualization of Tom Lehrer’s “The Elements“ song, I have been hoping someone with more talents than I would attack it from the CLR perspective. But alas. Here is my first crack at it:

System, data, SQL Client, Text and XML
Reflection and Collections, Port and Diagnostic hell
Windows Forms and Drawing, Web, U.I. and WebControl
and Timers, Threading, Logging. I.O., Ports and Protocols
Security, Cryptography, Discovery, Transactions
Configuration, Interop and Serial-i-zation
I don’t know what’s come over me, this constant revelation
It seems it’s from a lethal redpill/koolaid combination

ok – lame ending but hey, I gotta get back to work

[syndicated from Julia Lerman’s Don’t Be Iffy Blog. Please refer and comment here]

Boston.NET’s Longhorn Study Group

Just got this meeting announcement from Boston.NET and couldn’t help notice the special part (bolding etc are mine)

The January meeting of the Boston .NET User Group will be held tomorrow at the usual time, 5-8:30 p.m. We will hold the first meeting of our Longhorn Study Group from 5-6:30 and then are please to have Rocky Lhotka, noted author and speaker, as our featured speaker. Please register at http://www.bostondotnet.org and view the details on these events.

Wow. Already!!?!