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

# Get public key

> Allows the client to get the current server public key, or the public key of one of its own cryptographic keys.

## Overview

Allows the client to get the current server public key, or the public key of one of its own cryptographic keys. The client can use this key to validate signatures server  in relation to legal identities, smart contracts, tokens, etc.

Note: If a Key ID is provided, information about one of the keys of the client account is returned. If not Key ID is provided, information about the the public server key is returned.

Note 2: If no Key ID is provided, resource requires no authentication. If a Key ID is provided, a Bearer token identifying the client account must be provided.

## HTTP request

`POST /Agent/Crypto/GetPublicKey`

## Authentication

Requires a valid JWT bearer token.

## Request (JSON)

```json theme={null}
{
	"keyId": Optional(Str(PKeyId))
}
```

## Input parameters

| Parameter | Description                                                                                                                                                        |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| PKeyId    | Optional Key ID. If not provided, the server public key is returned. If provided, the public key of the corresponding cryptographic key of the client is returned. |

## Response (JSON)

```json theme={null}
{
	"key": Required(Str(PKey)),
	"Algorithm": 
	{
		"localName":Required(Str(PLocalName)),
		"namespace":Required(Str(PNamespace)),
		"securityStrength":Required(Int(PSecurityStrength)),
		"safe":Required(Boolean(PSafe)),
		"slow":Required(Boolean(PSlow)),
		"pqc":Required(Boolean(PPqc)),
		"score":Required(Int(PScore))
	}
}
```

## Response parameters

| Parameter         | Description                                                                                                    |
| ----------------- | -------------------------------------------------------------------------------------------------------------- |
| PKey              | Base64-encoded public key of the server.                                                                       |
| PLocalName        | Local Name of the algorithm.                                                                                   |
| PNamespace        | Namespace, defining the algorithm.                                                                             |
| PSecurityStrength | Security strength of algorithm (in bits).                                                                      |
| PSafe             | If the algorithm is considered safe according to [https://safecurves.cr.yp.to/](https://safecurves.cr.yp.to/). |
| PSlow             | If the algorithm is slow (i.e. computation intensive).                                                         |
| PPqc              | If the algorithm represents Post Quantum Cryptography (PQC).                                                   |
| PScore            | Algorithm score. Can be used, together with PSecurityStrength to order algorithms.                             |

## Notes

This endpoint uses the request schema notation described in [Pattern matching](/guides/pattern-matching).
