endpoint_newkey.txt 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. THE CSR GENERATING ENDPOINT
  2. Endpoint: /api/v1/cfssl/newkey
  3. Method: POST
  4. Required parameters:
  5. * hosts: the list of SANs (subject alternative names) for the
  6. requested CSR (certificate signing request)
  7. * names: the certificate subject for the requested CSR
  8. Optional parameters:
  9. * CN: the common name for the certificate subject in the requested
  10. CSR.
  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 CSR, 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 private key
  18. * certificate_request: a PEM-encoded certificate request
  19. * sums: a JSON object holding both MD5 and SHA1 digests for the certificate
  20. request
  21. Example:
  22. $ curl -d '{"hosts":["www.example.com"], "names":[{"C":"US", "ST":"California", "L":"San Francisco", "O":"example.com"}], "CN": "www.example.com"}' \
  23. ${CFSSL_HOST}/api/v1/cfssl/newkey \
  24. | python -m json.tool
  25. % Total % Received % Xferd Average Speed Time Time Time Current
  26. Dload Upload Total Spent Left Speed
  27. 100 1132 100 997 100 135 80572 10909 --:--:-- --:--:-- --:--:-- 83083
  28. {
  29. "errors": [],
  30. "messages": [],
  31. "result": {
  32. "certificate_request": "-----BEGIN CERTIFICATE REQUEST-----\nMIIBUTCB+QIBADBqMQswCQYDVQQGEwJVUzEUMBIGA1UEChMLZXhhbXBsZS5jb20x\nFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28xEzARBgNVBAgTCkNhbGlmb3JuaWExGDAW\nBgNVBAMTD3d3dy5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IA\nBKjGougrsMC6d8+kD4iACNHEGxo3SR4rhg/6n3HWlH4c9f2lNT92juNggq6cakNw\n5LexZmwHDi970YPgdFVSrJWgLTArBgkqhkiG9w0BCQ4xHjAcMBoGA1UdEQQTMBGC\nD3d3dy5leGFtcGxlLmNvbTAKBggqhkjOPQQDAgNHADBEAiBAfw0rotVugRtcqKWF\nnU9DwHXC7nKP4RUVodJo1oGuOwIgYH3hDgSMFsheuvhdzt7ZvLutWHkk6yIRLxJr\ncGsO9/c=\n-----END CERTIFICATE REQUEST-----\n",
  33. "private_key": "-----BEGIN EC PRIVATE KEY-----\nMHcCAQEEIO4Nlcbg29aPBqrBowuONq5U2HlvE/xOaCV65gXZ7NPQoAoGCCqGSM49\nAwEHoUQDQgAEqMai6CuwwLp3z6QPiIAI0cQbGjdJHiuGD/qfcdaUfhz1/aU1P3aO\n42CCrpxqQ3Dkt7FmbAcOL3vRg+B0VVKslQ==\n-----END EC PRIVATE KEY-----\n",
  34. "sums": {
  35. "certificate_request": {
  36. "md5": "95E25336DA65B58DA250C3B5FAA4B97F",
  37. "sha-1": "5F1ACE9D14F55E95FAA246A80474873C14E0F42F"
  38. }
  39. }
  40. },
  41. "success": true
  42. }