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

# List the GP public keys

> Lists the public keys of GP: the keys with `use: sig` verify the
challenge, the reply data and the PIN change proof; the keys with
`use: enc` encrypt the answer. The route takes no access token and allows
any CORS origin.

The reply is a JSON Web Key Set (RFC 7517), not a paginated list. Load it
with the JWKS parser of a JOSE library.



## OpenAPI

````yaml https://core.sandbox.gnosispay.in/partner-api/openapi.json get /v1/challenge/keys
openapi: 3.2.0
info:
  title: Gnosis Pay Partner API
  version: 1.0.0
  description: >-
    Server-to-server API for onboarding users, creating accounts and cards,
    moving

    funds, and managing the card lifecycle. Call this API only from a trusted

    backend. Every request requires a partner access token, and every resource
    is

    scoped to the authenticated partner. The exceptions are the routes that the

    cardholder's application calls directly to read and change card data

    (`GET /v1/challenge/keys` and the card routes of the encrypted data

    protocol): they take no token and allow any CORS origin.
servers:
  - url: https://core.prod.gnosispay.com/partner-api
    description: Production
    variables: {}
  - url: https://core.sandbox.gnosispay.in/core
    description: Sandbox
    variables: {}
security:
  - BearerAuth: []
tags:
  - name: KYC
  - name: Accounts
  - name: Cards
  - name: Encrypted data
    description: >-
      Lets the cardholder's application read the card data (PAN, CVV, expiration

      date and PIN) and set a new PIN. The card data is encrypted between the

      application and GP. Your backend and your network never see it, even when

      a request passes through them.


      ## Goals


      - Only the application and GP can read the card data or the new PIN.

      - The account owner approves each action: the cardholder's wallet signs an
        EIP-712 message for it.
      - Your access token alone cannot read or change card data.

      - The application can verify that each challenge and each reply came from
        GP.

      ## Algorithms


      | Use | Algorithm |

      |---|---|

      | Keys | `EC` on the `P-256` curve |

      | Signature (JWS) | `ES256` |

      | Key agreement (JWE) | `ECDH-ES` |

      | Content encryption (JWE) | `A256GCM` |

      | Key thumbprint | RFC 7638 with SHA-256, base64url without padding |

      | Wallet signature | EIP-712 (`eth_signTypedData_v4`), checked with
      ERC-1271 for a smart account |


      Every token is a JWT. A standard JOSE library can create and verify all of

      them.


      ## Flow


      ```mermaid

      sequenceDiagram
          autonumber
          participant APP as Application
          participant WALLET as Wallet
          participant BACKEND as Your backend
          participant GP

          APP->>APP: create a signature key pair and an encryption key pair
          APP->>BACKEND: thumbprint of the signature public key
          BACKEND->>GP: POST /v1/challenge
          GP-->>BACKEND: challenge (JWS)
          BACKEND-->>APP: challenge
          APP->>GP: GET /v1/challenge/keys
          GP-->>APP: GP public keys (JWKS)
          APP->>APP: verify the challenge
          APP->>WALLET: sign the EIP-712 message of the challenge
          WALLET-->>APP: signature
          APP->>GP: POST /v1/cards/... with the signed and encrypted answer (JWE)
          alt read the card details or the PIN
              GP-->>APP: data (JWE that holds a JWS)
          else change the PIN
              GP-->>APP: proof (JWS)
          end
          APP->>APP: verify the reply and delete both key pairs
      ```
  - name: PCI
  - name: 3DS
  - name: Card transactions
  - name: Deposits
  - name: Withdrawals
  - name: Webhooks
paths:
  /v1/challenge/keys:
    get:
      tags:
        - Encrypted data
      summary: List the GP public keys
      description: >-
        Lists the public keys of GP: the keys with `use: sig` verify the

        challenge, the reply data and the PIN change proof; the keys with

        `use: enc` encrypt the answer. The route takes no access token and
        allows

        any CORS origin.


        The reply is a JSON Web Key Set (RFC 7517), not a paginated list. Load
        it

        with the JWKS parser of a JOSE library.
      operationId: keys.list.v1
      parameters: []
      responses:
        '200':
          description: The request has succeeded.
          headers:
            Cache-Control:
              required: true
              description: '`max-age=300`. Cache the set for at most five minutes.'
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JWKSet'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - {}
components:
  schemas:
    JWKSet:
      type: object
      required:
        - keys
      properties:
        keys:
          type: array
          items:
            $ref: '#/components/schemas/JWK'
          description: >-
            The signature keys first, then the encryption keys. A key that GP
            will

            use soon is published before it becomes active, so a set can hold
            more

            than one key of each kind. Select a key by `use` and `kid`.
      description: A JSON Web Key Set (RFC 7517).
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int32
          description: HTTP status code.
        message:
          type: string
          description: Generic human-readable text for the status code. Do not parse it.
        reason:
          type: string
          description: >-
            Stable machine-readable code identifying the specific cause, present
            only

            for errors that expose one (e.g. `CREATE_CARD_LIMIT_EXCEEDED`).
            Branch on

            this rather than on `message`.
    JWK:
      type: object
      required:
        - kty
        - crv
        - x
        - 'y'
        - kid
        - use
        - alg
      properties:
        kty:
          type: string
          enum:
            - EC
          description: Key type. Always `EC`.
        crv:
          type: string
          enum:
            - P-256
          description: Curve. Always `P-256`.
        x:
          type: string
          description: The x coordinate of the public key, base64url without padding.
        'y':
          type: string
          description: The y coordinate of the public key, base64url without padding.
        kid:
          type: string
          description: The RFC 7638 thumbprint of the key.
        use:
          $ref: '#/components/schemas/JWKUse'
          description: What the key is for.
        alg:
          $ref: '#/components/schemas/JWKAlgorithm'
          description: The algorithm of the key.
      description: The public part of a GP key as a JSON Web Key (RFC 7517).
    JWKUse:
      type: string
      enum:
        - sig
        - enc
      description: What a GP key is for.
    JWKAlgorithm:
      type: string
      enum:
        - ES256
        - ECDH-ES
      description: The algorithm of a GP key.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: Bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.