Well, I used the openssl cli program, and cut everything out that wasn't required. The results can be seen here. https://gist.github.com/burner/4d87d1421e39627f84316bc2892e6103