Bouncy Castle: Create a Basic Certificate
Bouncy Castle is a pretty powerful cryptographic library. Unfortunately, one of its failings is a lack of proper documentation (Although there is a pretty comprehensive test project suite). As documentation is lacking, it can feel pretty good when you finally get Bouncy Castle to do something useful.
In this article I explain how to use Bouncy Castle (C# .NET variant) to create a simple certificate. For a source code example, please refer to my Certificate Generator tool (Certificate.cs)
For additional information on Bouncy Castle See these previous articles:
Bouncy Castle - what is it?
No, I'm not talking about the inflatable play castles. Bouncy Castle is an encryption library made available for Java and .NET platforms. I have run into it off and on over the last 4 years and recently implemented a Certificate Generator tool that uses the Bouncy Castle API for Key, Certificate and Keystore generation.
I'm getting back into it after being away for a year or so. Hopefully I'll have time to document some of the things I find this time around.
Test Tool: Certificate Generator
At work I do most of my Automation and tool development in C#.NET and PowerShell. To reduce dependency sprawl I code some things myself in C# when there may be existing utilities that perform a similar function (but in another language or that require cumbersome installation/setup, etc...). In this way I can keep things simple and more maintainable as the automation team grows and I work with additional engineers (I'm a team of 1 right now :) )
This Self Signed Certificate Generator tool is one piece of a systems level test I am performing on an Encryption Management product. As I've developed this Certificate Generator on my own time I feel comfortable sharing the project on my personal page.
The idea behind this tool is to make it simple to generate many certificates in DER or PKCS12 containers. I will be expanding the tool over time to allow for additional features- for now it's good enough for me.
Read on for details.
Note: The download link is at the bottom of the page
How to Compile Bouncy Castle 1.7 with MS Visual Studio C# Express 2010
I work in the Encryption management space and am in need of some tools to help scale test our product. To that end I am investigating BouncyCastle to see how it can be used in my projects.
After downloading the Bouncy Castle 1.7 source release I had to 'tweak' the project to get it to build. This article describes what I needed to do to get BouncyCastle 1.7 to compile in Visual Studio Expres 2010
For a run through on how to create a certificate using bouncy castle, see this BW article.
GIT part 2: Get TortoiseGIT working on Windows
After you setup a GIT repository on a central server (See GIT Article 1), you will probably want a GUI client you can easily use for day to day operations. This article will show how to get TortoiseGIT up and running on a windows workstation. I picked TortoiseGIT since I come from a Subversion background where I used TortoiseSVN on a regular basis.
GIT Part 1: Install the 'Server' and create a repository
My first exposure to GIT was around 14 months ago. I was trying to get a GIT 'Server' setup and working with several Windows workstations. After awhile I gave up and moved on to more interesting projects. SVN was working fine for me anyway, thank you very much.
GIT didn't show up on my radar again until last week. Over the next few weeks or so my employer will be migrating everyone from Subversion to GIT. As I don't have any concept of how to use GIT, it seems logical to spend some time getting acquainted with it before I have to start using it full time.
This article focuses on how to setup a GIT 'Server' and repository that can be accessed by anyone with SSH access to the server.
Update: GIT Article 2 covers how to get TortoiseGIT up and running
How to get SVN+SSH Working on Windows with a CLI SVN Client
As part of our ongoing automation efforts I was in need of setting up a script to automatically setup a few dev machines. One key step was automating the SVN Update process to ensure we had the latest source code from the mainline development group. As their SVN server uses SVN+SSH we needed to tweak our clients to get this to work in an automated fashion
While the Linux machines were simple to setup, we had more issues with the Windows machines. All the Windows machines had TortoiseSVN installed, which is an excellent GUI SVN Client- but does not provide CLI tools for automation. I had to come up with another solution to get SVN+SSH working at the command line on the windows boxes.
PowerShell function to connect to MSSQL Database
As part of an on-going automation effort I had need recently to have PowerShell connect to a Database and add a few entries. This could not have been easily accomlished with a typical .sql script since I needed to base the new entries off of dynamically generated entries in another table.
I didn't want to write a C# Console app as I may need to tweak the script on machines without visual studio from time to time (PowerShell is installed on almost all windows machines).
Grab bag - Cygwin SSH and Zombie bash processes on Windows and PowerShell symbols
Sometimes I find a lot of little things that are worth remembering but aren't worth making a whole article about. In Today's Grab Bag we have:
- Powershell null, true and false symbols
- Cygwin SSH + Bash zombie processes on Windows
- 'Dynamic' casting in C#.NET
SpecFlow project uses incorrect step definition or throws an ambiguous step error
One of my co-workers was having difficulty with their SpecFlow project this last week. When the test cases were executed either an incorrect step definition was being used or an error message appeared indicating that the step definition is ambiguous.
I was able to root cause the problem and want to document what I found.
