Create key pair

Generates a new cryptographic key pair for the given principal. The request has no body; the response returns public and private keys (the private value may only be shown once).

POST
{{host}}/v1/keypair?principal={{principal}}
VERB:POST
BASE URL:{{host}}/v1/keypair
QUERY STRING:?principal={{principal}}

Query parameters#

  • principalstring
    Required

    Principal whose cryptographic key pairs are managed.

    example: root

Headers#

Send these headers with the request. Names are case-insensitive per HTTP rules.
  • x-api-keyRequired

    Your BigState API key.

    *provide api key here*
  • Content-TypeRequired

    MIME type of the request body.

    application/json
  • AcceptRequired

    MIME types the client can understand in the response.

    application/json

See authentication headers here.

  • 200Response body · object

    A new key pair was generated. The private key may appear only in this response.

    {
    "publicKey": "{{publicKey}}",
    "privateKey": "{{privateKey}}"
    }
    • publicKeystring

      Public key (hex) for the new key pair.

    • privateKeystring

      Private key material (hex). May be returned only once; store it securely.

  • 401

    Unauthorized.

  • 403

    Access denied. The caller does not have sufficient rights to perform this operation.

  • 400Response body · object

    Bad request.

    {
    "error": 6,
    "desc": "Invalid request"
    }
    • errornumber

      Numeric error code. See the error codes reference for the full list.

    • descstring

      Human-readable description of the error.

Create key pair

Generate a new key pair for the principal (no request body; response includes public and private keys).

curl https://api.bigstate.dev/v1/keypair?principal=root \
--request POST \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json'

© 2024 BigState