Site Archives c#

.NET RSA provider and PEM interchange

PKI support in the .NET framework comes in the form of the RSACryptoServiceProvider class. However PKI is a standard used on all platforms not just .NET so interoperability is important. Strange, then, that the RSACryptoServiceProvider provides no mechanism to save the public and/or private key an RSACryptoServiceProvider instance in a portable format such as PEM. […]

Searching for a byte sequence in a byte array

I needed to find a sequence of bytes in a byte array. There’s the .IndexOf() extension method but this finds only one byte. What I want is a .Contains() extension method for byte arrays which is able accept an array of bytes as a parameter (the needle) representing the byte sequence to find in the […]

DKIM support added to SES application

Our SMTP service for Amazon SES has been updated to optionally include automatically generated DKIM signatures. This is a feature you can use to make it more likely your emails will reach their destination.

SMTP server for Amazon SES

A few weeks ago Amazon announced a new bulk emailing service it calls the Simple Email Service (SES). In principle using this service any organization can send upto 2000 email every day for free and up to 1 million a day, if you need volume, at what seems like a very reasonable cost. Of course […]

Isn’t Linq great?

The lack of ForEach extension method on types other than List meant I didn’t pay enough attention soon enough to Linq which is great to use. The fluent coding style, now I’m used to it, makes data management tasks seem easier (and here I mean management of POCO list and dictionaries not databases). Here’s a […]

Easy property validation for Caliburn Micro

Caliburn Micro (CM) is a great, lightweight MVVM framework for WPF, Silverlight and WP7. While CM will enable Binding.ValidatesOnDataErrors if a view model implements IDataErrorInfo automatically, it does not provide any specific support for property validation. This post is about an extension to CM which makes it possible, just by dropping a couple of ‘black-boxes’ […]

PKI and code signing for C#

This post is to document my understanding of the terms used in and standards used to implement Public Key Infrastructure (PKI) components. We use PKI components all the time when visiting an HTTPS site, signing an email or checking an executable is from who its supposed to be. I’ve a short term interest in code […]

Example certificate generation and signing for C#

To download the example code associated with this post on PKI boot camp click here. Why make a nominal charge? It took a while to figure out how to create certificates in C# so I know if you are looking to be able to generate certificates, generate and verify signatures then this example is going […]

Useful changes to BouncyCastle (C#)

This post provides some information relevant to the later post on PKI and codesigning for C#. BouncyCastle (BC) is an extensive and open source library originally developed in Java for all thing PKI, PGP, SSL, etc. There’s lightweight version of BC which seems to contain much of the BC essentials and which has been ported […]

Error writing large files using OpenXML

We recently encountered a problem writing large files using OpenXML from an Office add-in. When run as an execuable the same code doesn’t fail. The relevant part of the error message is “Unable to determine the identity of domain” which is from an IsolatedStorageException even though, at the time of the error, the code in […]