Skip to content
Browse files

Add facilities for managing SSL keys

  • Loading branch information...
1 parent e433c11 commit 72c088b476f08e79f466ca88631dfcd507123ceb @tedeh committed Aug 10, 2013
View
22 test/fixtures/keys/Makefile
@@ -0,0 +1,22 @@
+all: agent1-cert.pem ca1-cert.pem
+
+ca1-cert.pem: ca1.cnf
+ openssl req -new -x509 -days 9999 -config ca1.cnf -keyout ca1-key.pem -out ca1-cert.pem
+
+agent1-key.pem:
+ openssl genrsa -out agent1-key.pem 1024
+
+agent1-csr.pem: agent1.cnf agent1-key.pem
+ openssl req -new -config agent1.cnf -key agent1-key.pem -out agent1-csr.pem
+
+agent1-cert.pem: agent1-csr.pem ca1-cert.pem ca1-key.pem
+ openssl x509 -req \
+ -days 9999 \
+ -passin "pass:password" \
+ -in agent1-csr.pem \
+ -CA ca1-cert.pem \
+ -CAkey ca1-key.pem \
+ -CAcreateserial \
+ -out agent1-cert.pem
+
+.PHONY: all ca1-cert.pem agent1-key.pem agent1-csr.pem agent1-cert.pem
View
16 test/fixtures/keys/agent1-cert.pem
@@ -0,0 +1,16 @@
+-----BEGIN CERTIFICATE-----
+MIIChDCCAe0CCQDXQP0cu/j/wTANBgkqhkiG9w0BAQUFADCBhjELMAkGA1UEBhMC
+QUExDjAMBgNVBAgTBVN0YXRlMREwDwYDVQQHEwhMb2NhbGl0eTEPMA0GA1UEChMG
+SmF5c29uMRAwDgYDVQQLEwdUZXN0aW5nMRIwEAYDVQQDEwlsb2NhbGhvc3QxHTAb
+BgkqhkiG9w0BCQEWDm1haWxAdGVkZWgubmV0MB4XDTEzMDgxMDExMzczMloXDTQw
+MTIyNTExMzczMlowgYUxCzAJBgNVBAYTAkFBMQ4wDAYDVQQIEwVTdGF0ZTERMA8G
+A1UEBxMITG9jYWxpdHkxDzANBgNVBAoTBkpheXNvbjEPMA0GA1UECxMGSmF5c29u
+MRIwEAYDVQQDEwlsb2NhbGhvc3QxHTAbBgkqhkiG9w0BCQEWDm1haWxAdGVkZWgu
+bmV0MIG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/tN7KhFG/tD/e779CfDtrUaw4QMS3Zdv+kgG
+oEjJOsWmn7kKZLMSp0dp1bVdD6Aao925zX6u1dMIA9GsKOY6w1tkaoO+7L7vYROU
+d13GrKN0YSqSG6bnKyAI
+-----END CERTIFICATE REQUEST-----
View
15 test/fixtures/keys/agent1-key.pem
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXQIBAAKBgQDk5U/OLMfvwxKurDaVAUajupx9ANdvMJPiEz8ueasDkXsBDWZR
+68vfz3DgiOJpfXgKdNw+jvfK7ll1Ib3d57MQDG9aJCvoG3FwX4v3rpHAkBUKnX7o
+qonZOayqrZAIrL65rn6g3BErLn0ZK0cCDXGZtfy4CQry9ex1JxDt72EEGQIDAQAB
+AoGALG7fSRSkU0S48bN4fQBcaBgnnJR3PZxeeLpnv2va6Lxq9k9Vl32AfBfWv5+S
+5At5K/53aqVyMLCIKRa9tr/toEfTB88QD97DXx5cMHkFO143d7HLF8ehwadV+2t4
+nJYjpqZ0DqRCFNpphCjH2FKkXQpmjy12QzHYy0Omr0TXdwkCQQD9355ey9WLh7Qp
+MroeXmbaEDtkQwGr3u0HEP5FLan5f802lwKx3PeMCld3qcMHWIuyx1OkM26wqaA4
+AK1dbdlrAkEA5tAiHN78u43bkZk2sn7Xut8kRtIvyKr6Lll0cAe8iXdpghzhaId8
+q3StSpL2IT/l1Rh23bWoP2KvA4yhu06liwJAWNof2nuqlHf9RQH9A830X1OZBcEx
+345ZFMUMyPdvauQg1X9KsSdt+DRSYo4mtPZ3hi2fB3P8xJXJfnA2POHKWwJBANk8
+d37Y2OHlaAynOXXSMFTvhAMr/FFPqtxI0XBHt8liHGmbqQNq0YnF7PvNSd6Nd1GT
+Dv0o5kuSI8qhZ+8U3HUCQQDrlGc6jSud5PY1AGtZMujgYdvEiQi9gSYb2WUv/9qZ
+wvtBLZFSEle34jBxl5Ccx5yOqpaczDWYavdJa4OilW8e
+-----END RSA PRIVATE KEY-----
View
18 test/fixtures/keys/agent1.cnf
@@ -0,0 +1,18 @@
+[ req ]
+default_bits = 1024
+days = 999
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+prompt = no
+
+[ req_distinguished_name ]
+C = AA
+ST = State
+L = Locality
+O = Jayson
+OU = Jayson
+CN = localhost
+emailAddress = mail@tedeh.net
+
+[ req_attributes ]
+challengePassword = A challenge password
View
16 test/fixtures/keys/ca1-cert.pem
@@ -0,0 +1,16 @@
+-----BEGIN CERTIFICATE-----
+MIIChTCCAe4CCQDtej9SHolnoTANBgkqhkiG9w0BAQUFADCBhjELMAkGA1UEBhMC
+QUExDjAMBgNVBAgTBVN0YXRlMREwDwYDVQQHEwhMb2NhbGl0eTEPMA0GA1UEChMG
+SmF5c29uMRAwDgYDVQQLEwdUZXN0aW5nMRIwEAYDVQQDEwlsb2NhbGhvc3QxHTAb
+BgkqhkiG9w0BCQEWDm1haWxAdGVkZWgubmV0MB4XDTEzMDgxMDExMzczMloXDTQw
+MTIyNTExMzczMlowgYYxCzAJBgNVBAYTAkFBMQ4wDAYDVQQIEwVTdGF0ZTERMA8G
+A1UEBxMITG9jYWxpdHkxDzANBgNVBAoTBkpheXNvbjEQMA4GA1UECxMHVGVzdGlu
+ZzESMBAGA1UEAxMJbG9jYWxob3N0MR0wGwYJKoZIhvcNAQkBFg5tYWlsQHRlZGVo
+Lm5ldDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAzhmSFbrDG9wJRe5rUoRd
+GBl3BQBg2pET5QW+LsD+MlzJVO6Beytk555VdX4sDORUW2zmemLKw4z+5kKrthki
+8BP2FZTXYrbyA3yt7lNwtLpszZcKqIZFyElYju5l9xzNn9UK86ohg7MJ+4v3rLTW
+0CqwBeFhspbbkMFRqzOAj9kCAwEAATANBgkqhkiG9w0BAQUFAAOBgQBQd2n9aGwQ
+U+soZpwOxa7JEjArWu5JLr6nWRHxe5KdbVtBjddYQ3j98H5A1yMhtfQ8cwGtRkxF
+Wk0THhxStEEF8d2PJUfjCghgtyr/QkbPjJ/80iMZyPsdvEk4jEg+psFOeFONCZFo
+WeCT6WbbaYhlWQR96OmojiCbDwyUKW43+w==
+-----END CERTIFICATE-----
View
1 test/fixtures/keys/ca1-cert.srl
@@ -0,0 +1 @@
+D740FD1CBBF8FFC1
View
18 test/fixtures/keys/ca1-key.pem
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,09C750B62DC40F24
+
+KRfFnBIO/9WegpYKM7cc17mWaUSXx61xz3UghnL/T5QIAcr6SCIFHeWF+f2nNR8P
+8FfKovEZ2YoWXl0NSHiOsop2+LWDw8xKvo7WgPR+08KH9IbiNUDlncw+x0YFCkh4
+xvI13o+xGKtF6MyhFvHXBsc0lupW6kg5IL3wVvFxFT0H4vyYpPfbnWpyZPz3F2RZ
+OH9wZCLLOViX3rLKHu/XEOjJMFRHMqu0k+gCL/Um+jEGUMxk6Hz/IGr0HCosaPXP
+PHEUpxeeC7eXUC32fPqURs1Q1/c8gKk/BycbA8cvFoitfXtO9JY9hRQYj24tnK/u
+HrZZwJQosevYRwt3oBHbUDTvodRxzohOxQX5SAcJs5SviUPGQDcq5CN/bVK+mMOK
+TJUD0gMKum4QCafXAZnZ0nTzZW90IHUQb1E+CRXymCl5QYCnxRcNof5L5NYwUsQj
+bSCoNucRKP6wUA7/cQpBuX+2Ae+Z9ZLnKJ9lXribaOuRk2jOVJXLxxi4OmDRNJcI
+TuWdpb8tNTm2NQLXa0A6wjx3C459I6Be2f4czQCc2At0BATKP2LODWMRuQ2uZDAu
+h+GqLQRhp6Hv2MNMoBe/GABsaOX97SeUfitoKL6u9Ro/HcZU7UVX8y5s1lTTjp68
+JRRpG9RdPxbt8JLjvN7p6NF4IBGTbQGhrvqReKfVDk1asDINruOKpJ3U8upIj4Mr
+Seq/3K0B5rh/46+l/hIHKsctFP12Ly5Tk3EbRDVMw605Kp9ZIisPrH65pRUfcuwJ
+nAr7fpRWU67PkbdWhalrYe/ibJP8BefclPzVtRadHPOHZ7v282h0ug==
+-----END RSA PRIVATE KEY-----
View
19 test/fixtures/keys/ca1.cnf
@@ -0,0 +1,19 @@
+[ req ]
+default_bits = 1024
+days = 999
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+prompt = no
+output_password = password
+
+[ req_distinguished_name ]
+C = AA
+ST = State
+L = Locality
+O = Jayson
+OU = Testing
+CN = localhost
+emailAddress = mail@tedeh.net
+
+[ req_attributes ]
+challengePassword = A challenge password

0 comments on commit 72c088b

Please sign in to comment.
Something went wrong with that request. Please try again.