endpoint_init_ca.txt 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. THE CA CERTIFICATE GENERATING ENDPOINT
  2. Endpoint: /api/v1/cfssl/init_ca
  3. Method: POST
  4. Required parameters:
  5. * hosts: the list of SANs (subject alternative names) for the
  6. requested CA certificate
  7. * names: the certificate subject for the requested CA certificate
  8. Optional parameters:
  9. * CN: the common name for the certificate subject in the requested
  10. CA certificate.
  11. * key: the key algorithm and size for the newly generated private key,
  12. default to ECDSA-256
  13. * ca: the CA configuration of the requested CA, including CA pathlen
  14. and CA default expiry
  15. Result:
  16. The returned result is a JSON object with three keys:
  17. * private key: a PEM-encoded CA private key
  18. * certificate: a PEM-encoded self-signed CA certificate
  19. Example:
  20. $ curl -d '{"hosts":["www.example.com"], "names":[{"C":"US", "ST":"California", "L":"San Francisco", "O":"example.com"}], "CN": "www.example.com"}' \
  21. ${CFSSL_HOST}/api/v1/cfssl/init_ca \
  22. | python -m json.tool
  23. % Total % Received % Xferd Average Speed Time Time Time Current
  24. Dload Upload Total Spent Left Speed
  25. 100 1287 100 1152 100 135 36806 4313 --:--:-- --:--:-- --:--:-- 37161
  26. {
  27. "errors": [],
  28. "messages": [],
  29. "result": {
  30. "certificate": "-----BEGIN EC PRIVATE KEY-----\nMHcCAQEEIHSuWpkTLyX4pucRtUATncQaTYtTRJNDpt8j7cnBeVceoAoGCCqGSM49\nAwEHoUQDQgAEqj9wJFCAqvcLRRB+qSc/jxLgUHLTMUi6ko/JupAWI1V5SjZxuL4u\nh6HS3VE4fvCdcfa06PAAKiJBNsfPBcS/Ig==\n-----END EC PRIVATE KEY-----\n",
  31. "private_key": "-----BEGIN CERTIFICATE-----\nMIICMDCCAdagAwIBAgIIOdP968SD1xgwCgYIKoZIzj0EAwIwajELMAkGA1UEBhMC\nVVMxFDASBgNVBAoTC2V4YW1wbGUuY29tMRYwFAYDVQQHEw1TYW4gRnJhbmNpc2Nv\nMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRgwFgYDVQQDEw93d3cuZXhhbXBsZS5jb20w\nHhcNMTUwODAzMDYyODAwWhcNMjAwODAxMDYyODAwWjBqMQswCQYDVQQGEwJVUzEU\nMBIGA1UEChMLZXhhbXBsZS5jb20xFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28xEzAR\nBgNVBAgTCkNhbGlmb3JuaWExGDAWBgNVBAMTD3d3dy5leGFtcGxlLmNvbTBZMBMG\nByqGSM49AgEGCCqGSM49AwEHA0IABKo/cCRQgKr3C0UQfqknP48S4FBy0zFIupKP\nybqQFiNVeUo2cbi+Loeh0t1ROH7wnXH2tOjwACoiQTbHzwXEvyKjZjBkMA4GA1Ud\nDwEB/wQEAwIABjASBgNVHRMBAf8ECDAGAQH/AgECMB0GA1UdDgQWBBTH3jEBAIFt\nFFgJAI9lm8ktqxNt+DAfBgNVHSMEGDAWgBTH3jEBAIFtFFgJAI9lm8ktqxNt+DAK\nBggqhkjOPQQDAgNIADBFAiEA7s2UgPNJuQLzcXYNTQxhYqFq2+rbrJGC0WhYE8+r\n1yACIC5fsyyNNlw5HbSv4MDBwu3ozsMdfmoQTLVyijW/LC9r\n-----END CERTIFICATE-----\n"
  32. },
  33. "success": true
  34. }