endpoint_newcert.txt 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. THE CERTIFICATE GENERATING ENDPOINT
  2. Endpoint: /api/v1/cfssl/newcert
  3. Method: POST
  4. Required parameters:
  5. * request: a json object specifying the certificate request,
  6. exactly the one which can be sent to /api/v1/cfssl/newkey
  7. to generate a certificate signing request
  8. (referring to endpoint_newkey for how to write such object)
  9. Optional parameters:
  10. * label: a string specifying which signer to be appointed to sign
  11. the CSR, useful when interacting with cfssl server that stands
  12. in front of a remote multi-root CA signer
  13. * profile: a string specifying the signing profile for the signer
  14. * bundle: a boolean specifying whether to include an "optimal"
  15. certificate bundle along with the certificate
  16. Result:
  17. The returned result is a JSON object with four keys:
  18. * private key: a PEM-encoded private key
  19. * certificate_request: a PEM-encoded certificate request
  20. * certificate: a PEM-encoded certificate, signed by the server
  21. * sums: a JSON object holding both MD5 and SHA1 digests for the certificate
  22. request and the certificate; note that this is the digest of the DER
  23. contents of the certificate, not the PEM contents
  24. * bundle: See the result of endpoint_bundle.txt (only included if the bundle parameter was set)
  25. Example:
  26. $ curl -d '{ "request": {"hosts":["www.example.com"], "names":[{"C":"US", "ST":"California", "L":"San Francisco", "O":"example.com"}], "CN": "www.example.com"} }' \
  27. ${CFSSL_HOST}/api/v1/cfssl/newcert \
  28. | python -m json.tool
  29. % Total % Received % Xferd Average Speed Time Time Time Current
  30. Dload Upload Total Spent Left Speed
  31. 100 2487 0 2338 100 149 56536 3603 --:--:-- --:--:-- --:--:-- 57024
  32. {
  33. "errors": [],
  34. "messages": [],
  35. "result": {
  36. "certificate": "-----BEGIN CERTIFICATE-----\nMIIDRzCCAjGgAwIBAgIIV2zafpyQtp4wCwYJKoZIhvcNAQELMIGMMQswCQYDVQQG\nEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNj\nbzETMBEGA1UEChMKQ0ZTU0wgVEVTVDEbMBkGA1UEAxMSQ0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GEwJVUzEUMBIGA1UEChMLZXhhbXBsZS5jb20x\nFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28xEzARBgNVBAgTCkNhbGlmb3JuaWExGDAW\nBgNVBAMTD3d3dy5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IA\nBK/CtZaQ4VliKE+DLIVGLwtSxJgtUKRzGvN1EwI3HRgKDQ3l3urBIzHtUcdMq6HZ\nb8jX0O9fXYUOf4XWggrLk1agLTArBgkqhkiG9w0BCQ4xHjAcMBoGA1UdEQQTMBGC\nD3d3dy5leGFtcGxlLmNvbTAKBggqhkjOPQQDAgNIADBFAiAcvfhXnsLtzep2sKSa\n36W7G9PRbHh8zVGlw3Hph8jR1QIhAKfrgplKwXcUctU5grjQ8KXkJV8RxQUo5KKs\ngFnXYtkb\n-----END CERTIFICATE REQUEST-----\n",
  38. "private_key": "-----BEGIN EC PRIVATE KEY-----\nMHcCAQEEIJfVVIvXclN1jCWefEwhYYq7y1ya2RjxO5o8QjehD3YdoAoGCCqGSM49\nAwEHoUQDQgAEr8K1lpDhWWIoT4MshUYvC1LEmC1QpHMa83UTAjcdGAoNDeXe6sEj\nMe1Rx0yrodlvyNfQ719dhQ5/hdaCCsuTVg==\n-----END EC PRIVATE KEY-----\n",
  39. "sums": {
  40. "certificate": {
  41. "md5": "E9308D1892F1B77E6721EA2F79C026BE",
  42. "sha-1": "4640E6DEC2C40B74F46C409C1D31928EE0073D25",
  43. "sha-256": "8812010B59EB8C00CDD9292078717216B131A710703F18A4DFB94AC166F507DF"
  44. },
  45. "certificate_request": {
  46. "md5": "AA924136405006E36CEE39FED9CBA5D7",
  47. "sha-1": "DF955A43DF669D38E07BF0479789D13881DC9024",
  48. "sha-256": "C7600A68BDB689346E2E4438A374606DFC3FFD3B6B9722E0A8CB32AA88FBA686"
  49. }
  50. }
  51. },
  52. "success": true
  53. }