Skip to content

Instantly share code, notes, and snippets.

View pzb's full-sized avatar

Peter Bowen pzb

View GitHub Profile
pzb@noir:~/cvs/rubymail-git/mail (master)> rvm 1.9.1
pzb@noir:~/cvs/rubymail-git/mail (master)> rake spec
(in /home/pzb/cvs/rubymail-git/mail)
rake aborted!
undefined method `name' for #<Gem::Specification:0x87e9838>
/home/pzb/cvs/rubymail-git/mail/Rakefile:33:in `new'
(See full trace by running task with --trace)
pzb@noir:~/cvs/rubymail-git/mail (master)>
<?php
require_once 'cloudfusion/cloudfusion.class.php';
class EasyAmazonSDB
{
/* The CloudFusion SimpleDB object */
private $sdb;
/* Result of the last operation */
public $last_result = null;
@pzb
pzb / linux.c
Created September 17, 2010 09:17
/*
libparted - a library for manipulating disk partitions
Copyright (C) 1999 - 2005, 2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
--[[
Enchantrix Addon for World of Warcraft(tm).
Version: <%version%> (<%codename%>)
Revision: $Id: EnxConstants.lua 4632 2010-01-24 02:33:54Z ccox $
URL: http://enchantrix.org/
Enchantrix Constants for Jewelcrafting / Prospecting
License:
This program is free software; you can redistribute it and/or
#!/usr/bin/env ruby
require 'openssl'
ROOT_KEY='rootca.key'
ISSUER_KEY='issuerca.key'
EE_KEY='ee.key'
if File.exist? ROOT_KEY
print "Using existing root key\n"
root_key = OpenSSL::PKey::RSA.new(File.read(ROOT_KEY))

DNS-Based Authorization by Domain Name Registrant

In the definitions below, $FQDN represents the Fully-Qualified Domain Name (FQDN) requested in the certificate subject, $DOMAIN represents the Registered Domain Name portion of the FQDN, and ${FQDN-n} is the FQDN with the first n labels pruned.

Comodo

Calculate the MD5 and SHA1 hashes of the DER encoding of the CSR that will be sent to Comodo. Let these be $CSRMD5 and $CSRSHA1 respectively. If requesting a non-wildcard FQDN, create the following record:

$CSRMD5.$FQDN. IN CNAME $CSRSHA1.comodoca.com.
Bytes: 409
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 1 (0x1)
Signature Algorithm: ecdsa-with-SHA256
Issuer: C=US, O=Eggman, OU=Root CA 1
Validity
Not Before: Jan 1 00:00:01 2004 GMT
Not After : Dec 31 23:59:59 2028 GMT
Bytes: 1011
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 0 (0x0)
Signature Algorithm: sha256WithRSAEncryption
Issuer: C=US, ST=Montana, L=Livingston, O=Aperture Science Corporation, CN=Aperture Science Portal Certificate Authority - R4
Validity
Not Before: Jan 1 00:00:01 2004 GMT
Not After : Dec 31 23:59:59 2028 GMT
@pzb
pzb / gist:fe0d06bb292506c1db7f
Created March 25, 2015 02:45
CA Certificate types

1.1.2.1 CA Certificates

A certificate is a CA certificate if basicConstraints extension is present and has cA:TRUE.

1.1.2.1.1 Self-signed CA Certificates

A certificate is a Self-signed CA certificate if the following are true:

  • The basicConstraints extension is present and has cA:TRUE
  • The subject and issuer DNs of the certificate match
  • The certificate signature is validated by the subject public key
#!/usr/bin/ruby
require 'rubygems'
require 'net/http'
require 'uri'
require 'json'
require 'bindata'
require 'base64'
require 'openssl'
require 'digest/sha1'
require 'pp'