> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gobl.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate a signing key pair

> Creates a new ES256 (ECDSA P-256) key pair for signing and verification.



## OpenAPI

````yaml /openapi/v0.json post /keygen
openapi: 3.1.0
info:
  title: GOBL API
  description: >-
    Go Business Language — build, validate, sign, and query tax-aware business
    documents.
  version: v0
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  contact:
    name: Invopop
    url: https://gobl.org
servers:
  - url: https://gobl.dev/v0
    description: Production
  - url: /v0
    description: Local
security: []
tags:
  - name: Documents
    description: Build, validate, correct, and replicate GOBL documents.
  - name: Signing
    description: Sign and verify GOBL envelopes.
  - name: Reference
    description: JSON schemas, tax regimes, and format addons.
  - name: Meta
    description: Service metadata.
paths:
  /keygen:
    post:
      tags:
        - Signing
      summary: Generate a signing key pair
      description: Creates a new ES256 (ECDSA P-256) key pair for signing and verification.
      operationId: keygen
      responses:
        '200':
          description: Generated key pair
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KeygenResponse'
components:
  schemas:
    KeygenResponse:
      type: object
      properties:
        private:
          $ref: '#/components/schemas/JWK'
          description: ES256 private key.
        public:
          $ref: '#/components/schemas/JWK'
          description: Corresponding public key.
    JWK:
      type: object
      description: JSON Web Key (RFC 7517) — ES256 / P-256.
      properties:
        kty:
          type: string
          example: EC
        crv:
          type: string
          example: P-256
        alg:
          type: string
          example: ES256
        use:
          type: string
          example: sig
        kid:
          type: string
          format: uuid
        x:
          type: string
          description: Base64url-encoded X coordinate.
        'y':
          type: string
          description: Base64url-encoded Y coordinate.
        d:
          type: string
          description: Base64url-encoded private exponent (private keys only).

````