File: endpoint_newkey.txt

package info (click to toggle)
golang-github-cloudflare-cfssl 1.2.0%2Bgit20160825.89.7fb22c8-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,916 kB
  • ctags: 2,827
  • sloc: sh: 146; sql: 62; python: 11; makefile: 8
file content (54 lines) | stat: -rw-r--r-- 2,453 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
THE CSR GENERATING ENDPOINT

Endpoint: /api/v1/cfssl/newkey
Method:   POST

Required parameters:

    * hosts: the list of SANs (subject alternative names) for the
    requested CSR (certificate signing request)
    * names: the certificate subject for the requested CSR

Optional parameters:

    * CN: the common name for the certificate subject in the requested
    CSR.
    * key: the key algorithm and size for the newly generated private key,
    default to ECDSA-256
    * ca: the CA configuration of the requested CSR, including CA pathlen
    and CA default expiry


Result:

    The returned result is a JSON object with three keys:

    * private key: a PEM-encoded private key
    * certificate_request: a PEM-encoded certificate request
    * sums: a JSON object holding both MD5 and SHA1 digests for the certificate
    request

Example:

    $ curl -d '{"hosts":["www.example.com"], "names":[{"C":"US", "ST":"California", "L":"San Francisco", "O":"example.com"}], "CN": "www.example.com"}' \
          ${CFSSL_HOST}/api/v1/cfssl/newkey  \
          | python -m json.tool

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1132  100   997  100   135  80572  10909 --:--:-- --:--:-- --:--:-- 83083
{
    "errors": [],
    "messages": [],
    "result": {
        "certificate_request": "-----BEGIN CERTIFICATE REQUEST-----\nMIIBUTCB+QIBADBqMQswCQYDVQQGEwJVUzEUMBIGA1UEChMLZXhhbXBsZS5jb20x\nFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28xEzARBgNVBAgTCkNhbGlmb3JuaWExGDAW\nBgNVBAMTD3d3dy5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IA\nBKjGougrsMC6d8+kD4iACNHEGxo3SR4rhg/6n3HWlH4c9f2lNT92juNggq6cakNw\n5LexZmwHDi970YPgdFVSrJWgLTArBgkqhkiG9w0BCQ4xHjAcMBoGA1UdEQQTMBGC\nD3d3dy5leGFtcGxlLmNvbTAKBggqhkjOPQQDAgNHADBEAiBAfw0rotVugRtcqKWF\nnU9DwHXC7nKP4RUVodJo1oGuOwIgYH3hDgSMFsheuvhdzt7ZvLutWHkk6yIRLxJr\ncGsO9/c=\n-----END CERTIFICATE REQUEST-----\n",
        "private_key": "-----BEGIN EC PRIVATE KEY-----\nMHcCAQEEIO4Nlcbg29aPBqrBowuONq5U2HlvE/xOaCV65gXZ7NPQoAoGCCqGSM49\nAwEHoUQDQgAEqMai6CuwwLp3z6QPiIAI0cQbGjdJHiuGD/qfcdaUfhz1/aU1P3aO\n42CCrpxqQ3Dkt7FmbAcOL3vRg+B0VVKslQ==\n-----END EC PRIVATE KEY-----\n",
        "sums": {
            "certificate_request": {
                "md5": "95E25336DA65B58DA250C3B5FAA4B97F",
                "sha-1": "5F1ACE9D14F55E95FAA246A80474873C14E0F42F"
            }
        }
    },
    "success": true
}