Class Architecture That Builds CryptoCollaboration
I went through a class architecture / code review of CryptoCollaboration this afternoon. Taking some feedback from Andy (his site is located here), I have been able to build and deploy a SharePoint list definition with the relevant event handlers that upon upload, will encrypt a document. There is also the option within a pre-exisiting document library to enable the cryptographic feature of CryptoCollaboration, in order to encrypt document on a point-to-point basis.
There are several classes that build the CryptoCollaboration solution. In order to handle the events that happen with the cryptographic events in SharePoint, there is a class builds up an encryption factory inheriting from the System.EventArgs base class. This is an important class to CryptoCollaboration because inheriting from System.EventArgs is because it allows the creation of generic handling, and is a convenient option to use for future expansion of further events (such as string encryption with lists). The ExtendInfo property that returns an object also allows for a certain level of customization, which is important for my current circumstances. Of course, the status of the encryption calls into this class in order to gather the status of the encryption process by use of a delegate.
In order to handle exceptions that occur within CryptoCollabortion, there are several class that inherit from the ApplicationException base class. Such as exceptions as invalid file input / out and password length follow this convention. The reasons why I love to handle exceptions this way is explained in this post.
The main encryption processing is handled with the CryptoCollaboration main component class. The main component class is the real worker bee of the entire encryption process sinking that happens through the entire process. This class contains the Encrypt() and Decrypt() methods, as well as intializing the relevant encryption algorithms out of the System.Security.Cryptography namespace. Out of the same namespace, within the same class, the relevant hashing functionality is called. All of the relevant property validation is also handled within this class.
All of this is pretty high level, and the entire solution is constantly being developed against. I am sure some of it will change when it is actually released, and since it will be open-source, will make a lot more sense when it is released.
I am making good progress on it (the CAPTCHA Field Control is taking some of my time) and it should be out relatively soon.