Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cfssl使用练习 #15

Open
zhouhaibing089 opened this issue Aug 1, 2016 · 0 comments
Open

cfssl使用练习 #15

zhouhaibing089 opened this issue Aug 1, 2016 · 0 comments
Labels

Comments

@zhouhaibing089
Copy link
Owner

zhouhaibing089 commented Aug 1, 2016

cfssl是cloudflare提供的开源的PKI解决方案.

安装

$ go get -u github.com/cloudflare/cfssl/cmd/...

生成cert

准备CSR(certificate signing request)

创建一个文件csr.json包含下面的内容:

{
  "CN": "zhouhaibing.com",
  "names": [
    {
      "C": "CN",
      "L": "Shanghai",
      "O": "Zhouhaibing, Inc",
      "OU": "Blog",
      "ST": "Shanghai"
    }
  ],
  "hosts": [
    "www.zhouhaibing.com"
  ]
}

术语介绍:

CN: Common Name
C: Country
L: Locality
O: Organization Name
OU: Organization Unit Name
ST: State

执行命令

$ cfssl gencert -initca csr.json
2016/08/01 23:21:46 [INFO] generating a new CA key and certificate from CSR
2016/08/01 23:21:46 [INFO] generate received request
2016/08/01 23:21:46 [INFO] received CSR
2016/08/01 23:21:46 [INFO] generating key: ecdsa-256
2016/08/01 23:21:46 [INFO] encoded CSR
2016/08/01 23:21:46 [INFO] signed certificate with serial number 383554376491257930289138538887168576708201738251
{"cert":"-----BEGIN CERTIFICATE-----\nMIICVDCCAfmgAwIBAgIUQy8sTv8g7ksr6DnCtbz4f4OA8AswCgYIKoZIzj0EAwIw\ndzELMAkGA1UEBhMCQ04xETAPBgNVBAgTCFNoYW5naGFpMREwDwYDVQQHEwhTaGFu\nZ2hhaTEZMBcGA1UEChMQWmhvdWhhaWJpbmcsIEluYzENMAsGA1UECxMEQmxvZzEY\nMBYGA1UEAxMPemhvdWhhaWJpbmcuY29tMB4XDTE2MDgwMTE1MTcwMFoXDTIxMDcz\nMTE1MTcwMFowdzELMAkGA1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6ewpRq7vjU=\n-----END CERTIFICATE REQUEST-----\n","key":"-----BEGIN EC PRIVATE KEY-----\nMHcCAQEEIH5fA3JMrlg2gaIWtnRFGSNtVuOgfaa2VhkhCyKLlq8foAoGCCqGSM49\nAwEHoUQDQgAE/6XcKgm+e2RoXBIzE2apNbJgrU6OOfLwl++YMXAiYfYYkwTzC6nV\nLQkblE7MqdhB62U2yaQ4eVhU7LGTw+cdAw==\n-----END EC PRIVATE KEY-----\n"}

Certificate(保存为cert.pem)

-----BEGIN CERTIFICATE-----
MIICVDCCAfmgAwIBAgIUQy8sTv8g7ksr6DnCtbz4f4OA8AswCgYIKoZIzj0EAwIw
dzELMAkGA1UEBhMCQ04xETAPBgNVBAgTCFNoYW5naGFpMREwDwYDVQQHEwhTaGFu
Z2hhaTEZMBcGA1UEChMQWmhvdWhhaWJpbmcsIEluYzENMAsGA1UECxMEQmxvZzEY
MBYGA1UEAxMPemhvdWhhaWJpbmcuY29tMB4XDTE2MDgwMTE1MTcwMFoXDTIxMDcz
MTE1MTcwMFowdzELMAkGA1UEBhMCQ04xETAPBgNVBAgTCFNoYW5naGFpMREwDwYD
VQQHEwhTaGFuZ2hhaTEZMBcGA1UEChMQWmhvdWhhaWJpbmcsIEluYzENMAsGA1UE
CxMEQmxvZzEYMBYGA1UEAxMPemhvdWhhaWJpbmcuY29tMFkwEwYHKoZIzj0CAQYI
KoZIzj0DAQcDQgAE/6XcKgm+e2RoXBIzE2apNbJgrU6OOfLwl++YMXAiYfYYkwTz
C6nVLQkblE7MqdhB62U2yaQ4eVhU7LGTw+cdA6NjMGEwDgYDVR0PAQH/BAQDAgEG
MA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFP4ULg1NyWJGy1WWS5QnddqvJFA/
MB8GA1UdIwQYMBaAFP4ULg1NyWJGy1WWS5QnddqvJFA/MAoGCCqGSM49BAMCA0kA
MEYCIQC6LfkqcT6DUmIdRVVwKVwsrnKzi+twXK6QmO4crC+2nwIhAIEO06GTWY+n
eV50MnRaDsyOQaELTUxaD8WHi2ajzcf3
-----END CERTIFICATE-----

CSR(保存为csr.pem)

-----BEGIN CERTIFICATE REQUEST-----
MIIBYzCCAQoCAQAwdzELMAkGA1UEBhMCQ04xETAPBgNVBAgTCFNoYW5naGFpMREw
DwYDVQQHEwhTaGFuZ2hhaTEZMBcGA1UEChMQWmhvdWhhaWJpbmcsIEluYzENMAsG
A1UECxMEQmxvZzEYMBYGA1UEAxMPemhvdWhhaWJpbmcuY29tMFkwEwYHKoZIzj0C
AQYIKoZIzj0DAQcDQgAE/6XcKgm+e2RoXBIzE2apNbJgrU6OOfLwl++YMXAiYfYY
kwTzC6nVLQkblE7MqdhB62U2yaQ4eVhU7LGTw+cdA6AxMC8GCSqGSIb3DQEJDjEi
MCAwHgYDVR0RBBcwFYITd3d3Lnpob3VoYWliaW5nLmNvbTAKBggqhkjOPQQDAgNH
ADBEAiAef5tC9tDN/jCxUrykrzgsuovo2gII4lF62k+xvs69pwIgRn2sZxyqgXl6
nEoHIqkCfj/hFgIKycDff6ewpRq7vjU=
-----END CERTIFICATE REQUEST-----

Key(保存为key.pem)

-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIH5fA3JMrlg2gaIWtnRFGSNtVuOgfaa2VhkhCyKLlq8foAoGCCqGSM49
AwEHoUQDQgAE/6XcKgm+e2RoXBIzE2apNbJgrU6OOfLwl++YMXAiYfYYkwTzC6nV
LQkblE7MqdhB62U2yaQ4eVhU7LGTw+cdAw==
-----END EC PRIVATE KEY-----

使用原来的key重新生成

$ cfssl gencert -initca -ca-key key.pem csr.json
2016/08/01 23:36:12 [INFO] re-generate a CA certificate from CSR and CA key
2016/08/01 23:36:12 [INFO] encoded CSR
2016/08/01 23:36:12 [INFO] signed certificate with serial number 641077971872565793088226430583424274397423810453
{"cert":"-----BEGIN CERTIFICATE-----\nMIICVDCCAfmgAwIBAgIUcEruM+6ZQkLk0+kpscZJOVE5N5UwCgYIKoZIzj0EAwIw\ndzELMAkGA1U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6nVLQkblE7MqdhB62U2yaQ4eVhU7LGTw+cdA6AxMC8GCSqGSIb3DQEJDjEi\nMCAwHgYDVR0RBBcwFYITd3d3Lnpob3VoYWliaW5nLmNvbTAKBggqhkjOPQQDAgNI\nADBFAiEAxqwHACB/nfPO3yHoLj7xb+LOdnfi4BzGsW5xBSWvzr8CICJ1tqaNptKP\nr1vJRt5cqpcyP0UDPVN5x50G5g/BXKfg\n-----END CERTIFICATE REQUEST-----\n"}

使用原来的ca和key重新生成

$ cfssl gencert -renewca -ca cert.pem -ca-key key.pem
2016/08/01 23:34:16 [INFO] re-generate a CA certificate from CA cert and key
2016/08/01 23:34:16 [INFO] encoded CSR
2016/08/01 23:34:16 [INFO] signed certificate with serial number 322373581305156619060220203161310979586448733394
{"cert":"-----BEGIN CERTIFICATE-----\nMIICUzCCAfmgAwIBAgIUOHe7OTJHby5l65pDjtG1upFwtNIwCgYIKoZIzj0EAwIw\ndzELMAkGA1UEBhMCQ04xETAPBgNVBAgTCFNoYW5naGFpMREwDwYDVQQHEwhTaGFu\nZ2hhaTEZMBcGA1UEChMQWmhvdWhhaWJpbmcsIEluYzENMAsGA1UECxMEQmxvZzEY\nMBYGA1UEAxMPemhvdWhhaWJpbmcuY29tMB4XDTE2MDgwMTE1MjkwMFoXDTIxMDcz\nMTE1MjkwMFowdzELMAkGA1UEBhMCQ04xETAPBgNVBAgTCFNoYW5naGFpMREwDwYD\nVQQHEwhTaGFuZ2hhaTEZMBcGA1UEChMQWmhvdWhhaWJpbmcsIEluYzENMAsGA1UE\nCxMEQmxvZzEYMBYGA1UEAxMPemhvdWhhaWJpbmcuY29tMFkwEwYHKoZIzj0CAQYI\nKoZIzj0DAQcDQgAE/6XcKgm+e2RoXBIzE2apNbJgrU6OOfLwl++YMXAiYfYYkwTz\nC6nVLQkblE7MqdhB62U2yaQ4eVhU7LGTw+cdA6NjMGEwDgYDVR0PAQH/BAQDAgEG\nMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFP4ULg1NyWJGy1WWS5QnddqvJFA/\nMB8GA1UdIwQYMBaAFP4ULg1NyWJGy1WWS5QnddqvJFA/MAoGCCqGSM49BAMCA0gA\nMEUCIQDDNOgXKJdq2QuT0MUH7WSWFvPJx0/1YzoKdp+ljHb2BQIgSmnX7hARr0Cd\n2xuSYEXik0RwteIEkEbkdqfxMSxWCx4=\n-----END CERTIFICATE-----\n"}

生成Key

使用上面相同的csr.json文件, 执行以下命令:

$ cfssl genkey csr.json
2016/08/01 23:41:10 [INFO] generate received request
2016/08/01 23:41:10 [INFO] received CSR
2016/08/01 23:41:10 [INFO] generating key: ecdsa-256
2016/08/01 23:41:10 [INFO] encoded CSR
{"csr":"-----BEGIN CERTIFICATE REQUEST-----\nMIIBZDCCAQoCAQAwdzELMAkGA1UEBhMCQ04xETAPBgNVBAgTCFNoYW5naGFpMREw\nDwYDVQQHEwhTaGFuZ2hhaTEZMBcGA1UEChMQWmhvdWhhaWJpbmcsIEluYzENMAsG\nA1UECxMEQmxvZzEYMBYGA1UEAxMPemhvdWhhaWJpbmcuY29tMFkwEwYHKoZIzj0C\nAQYIKoZIzj0DAQcDQgAEtsYJPkdoh+QvcFoZxs50W732/FFDuPgrlcCio5G5GroN\n5/eaL4Jf5UrapLEgDQ/c4v52eKuRFO7Ii5mm1nXJh6AxMC8GCSqGSIb3DQEJDjEi\nMCAwHgYDVR0RBBcwFYITd3d3Lnpob3VoYWliaW5nLmNvbTAKBggqhkjOPQQDAgNI\nADBFAiAPEDcS3v5s1qpzuZV9QXAZvtIQNthXTYUDCb3UWokzRAIhALTqONiBI66Q\nKg/iv+bV1WZXhBqIN9xchUvjKm9V4yIe\n-----END CERTIFICATE REQUEST-----\n","key":"-----BEGIN EC PRIVATE KEY-----\nMHcCAQEEIFr/NIn8JC+EHju7jF1P5iX+Ui/T8bIgpACjlPHL+ChjoAoGCCqGSM49\nAwEHoUQDQgAEtsYJPkdoh+QvcFoZxs50W732/FFDuPgrlcCio5G5GroN5/eaL4Jf\n5UrapLEgDQ/c4v52eKuRFO7Ii5mm1nXJhw==\n-----END EC PRIVATE KEY-----\n"}

查看cert信息

$ cfssl certinfo -cert cert.pem
{"subject":{"common_name":"zhouhaibing.com","country":"CN","organization":"Zhouhaibing, Inc","organizational_unit":"Blog","locality":"Shanghai","province":"Shanghai","names":["CN","Shanghai","Shanghai","Zhouhaibing, Inc","Blog","zhouhaibing.com"]},"issuer":{"common_name":"zhouhaibing.com","country":"CN","organization":"Zhouhaibing, Inc","organizational_unit":"Blog","locality":"Shanghai","province":"Shanghai","names":["CN","Shanghai","Shanghai","Zhouhaibing, Inc","Blog","zhouhaibing.com"]},"serial_number":"383554376491257930289138538887168576708201738251","not_before":"2016-08-01T15:17:00Z","not_after":"2021-07-31T15:17:00Z","sigalg":"ECDSAWithSHA256","authority_key_id":"FE:14:2E:D:4D:C9:62:46:CB:55:96:4B:94:27:75:DA:AF:24:50:3F","subject_key_id":"FE:14:2E:D:4D:C9:62:46:CB:55:96:4B:94:27:75:DA:AF:24:50:3F","pem":"-----BEGIN CERTIFICATE-----\nMIICVDCCAfmgAwIBAgIUQy8sTv8g7ksr6DnCtbz4f4OA8AswCgYIKoZIzj0EAwIw\ndzELMAkGA1UEBhMCQ04xETAPBgNVBAgTCFNoYW5naGFpMREwDwYDVQQHEwhTaGFu\nZ2hhaTEZMBcGA1UEChMQWmhvdWhhaWJpbmcsIEluYzENMAsGA1UECxMEQmxvZzEY\nMBYGA1UEAxMPemhvdWhhaWJpbmcuY29tMB4XDTE2MDgwMTE1MTcwMFoXDTIxMDcz\nMTE1MTcwMFowdzELMAkGA1UEBhMCQ04xETAPBgNVBAgTCFNoYW5naGFpMREwDwYD\nVQQHEwhTaGFuZ2hhaTEZMBcGA1UEChMQWmhvdWhhaWJpbmcsIEluYzENMAsGA1UE\nCxMEQmxvZzEYMBYGA1UEAxMPemhvdWhhaWJpbmcuY29tMFkwEwYHKoZIzj0CAQYI\nKoZIzj0DAQcDQgAE/6XcKgm+e2RoXB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OPQMBBwNCAAT/pdwqCb57ZGhcEjMTZqk1smCtTo458vCX75gxcCJh9hiTBPMLqdUtCRuUTsyp2EHrZTbJpDh5WFTssZPD5x0DoDEwLwYJKoZIhvcNAQkOMSIwIDAeBgNVHREEFzAVghN3d3cuemhvdWhhaWJpbmcuY29t","RawSubjectPublicKeyInfo":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/6XcKgm+e2RoXBIzE2apNbJgrU6OOfLwl++YMXAiYfYYkwTzC6nVLQkblE7MqdhB62U2yaQ4eVhU7LGTw+cdAw==","RawSubject":"MHcxCzAJBgNVBAYTAkNOMREwDwYDVQQIEwhTaGFuZ2hhaTERMA8GA1UEBxMIU2hhbmdoYWkxGTAXBgNVBAoTEFpob3VoYWliaW5nLCBJbmMxDTALBgNVBAsTBEJsb2cxGDAWBgNVBAMTD3pob3VoYWliaW5nLmNvbQ==","Version":0,"Signature":"MEQCIB5/m0L20M3+MLFSvKSvOCy6i+jaAgjiUXraT7G+zr2nAiBGfaxnHKqBeXqcSgciqQJ+P+EWAgrJwN9/p7ClGru+NQ==","SignatureAlgorithm":10,"PublicKeyAlgorithm":3,"PublicKey":{"Curve":{"P":1.1579208921035625e+77,"N":1.1579208921035625e+77,"B":4.105836372515214e+76,"Gx":4.8439561293906455e+76,"Gy":3.6134250956749796e+76,"BitSize":256,"Name":"P-256"},"X":1.1563282567196158e+77,"Y":1.1115269044001543e+76},"Subject":{"Country":["CN"],"Organization":["Zhouhaibing, Inc"],"OrganizationalUnit":["Blog"],"Locality":["Shanghai"],"Province":["Shanghai"],"StreetAddress":null,"PostalCode":null,"SerialNumber":"","CommonName":"zhouhaibing.com","Names":[{"Type":[2,5,4,6],"Value":"CN"},{"Type":[2,5,4,8],"Value":"Shanghai"},{"Type":[2,5,4,7],"Value":"Shanghai"},{"Type":[2,5,4,10],"Value":"Zhouhaibing, Inc"},{"Type":[2,5,4,11],"Value":"Blog"},{"Type":[2,5,4,3],"Value":"zhouhaibing.com"}],"ExtraNames":null},"Attributes":[{"Type":[1,2,840,113549,1,9,14],"Value":[[{"Type":[2,5,29,17],"Value":"MBWCE3d3dy56aG91aGFpYmluZy5jb20="}]]}],"Extensions":[{"Id":[2,5,29,17],"Critical":false,"Value":"MBWCE3d3dy56aG91aGFpYmluZy5jb20="}],"ExtraExtensions":null,"DNSNames":["www.zhouhaibing.com"],"EmailAddresses":null,"IPAddresses":null}

查看其它host的cert

$ cfssl certinfo -domain github.com
{"subject":{"common_name":"github.com","serial_number":"5157550","country":"US","organization":"GitHub, Inc.","locality":"San Francisco","province":"California","street_address":"88 Colin P Kelly, Jr Street","postal_code":"94107","names":["Private Organization","US","Delaware","5157550","88 Colin P Kelly, Jr Street","94107","US","California","San Francisco","GitHub, Inc.","github.com"]},"issuer":{"common_name":"DigiCert SHA2 Extended Validation Server CA","country":"US","organization":"DigiCert Inc","organizational_unit":"www.digicert.com","names":["US","DigiCert Inc","www.digicert.com","DigiCert SHA2 Extended Validation Server CA"]},"serial_number":"15938810608981134066197160231674485287","sans":["github.com","www.github.com"],"not_before":"2016-03-10T00:00:00Z","not_after":"2018-05-17T12:00:00Z","sigalg":"SHA256WithRSA","authority_key_id":"3D:D3:50:A5:D6:A0:AD:EE:F3:4A:60:A:65:D3:21:D4:F8:F8:D6:F","subject_key_id":"88:5C:48:67:19:CC:A0:76:59:2D:11:79:C3:BE:A2:AC:87:22:27:5B","pem":"-----BEGIN CERTIFICATE-----\nMIIHeTCCBmGgAwIBAgIQC/20CQrXteZAwwsWyVKaJzANBgkqhkiG9w0BAQsFADB1\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3\nd3cuZGlnaWNlcnQuY29tMTQwMgYDVQQDEytEaWdpQ2VydCBTSEEyIEV4dGVuZGVk\nIFZhbGlkYXRpb24gU2VydmVyIENBMB4XDTE2MDMxMDAwMDAwMFoXDTE4MDUxNzEy\nMDAwMFowgf0xHTAbBgNVBA8MFFBya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ufV7cz3pY\nRDS4BF+EEFQ4l5GY+yp4WJA/xSvYsTHWeWxRD1/nl62/Rd9FN2NkacRVozCxRVle\nFrBHTFxqIP6kDnxiLElBrZngtY07ietaYZVLQN/ETyqLQftsf8TecwTklbjvm8NT\nJqbaIVifYwqwNN+4lRxS3F5lNlA/il12IOgbRioLI62o8G0DaEUQgHNf8vSG\n-----END CERTIFICATE-----\n"}
@zhouhaibing089 zhouhaibing089 added blog and removed blog labels Dec 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant