[Yandex Cloud documentation](../../../../index.md) > [Yandex Key Management Service](../../../index.md) > API reference > REST > [Key Management Service API](../index.md) > [AsymmetricEncryptionCrypto](index.md) > GetPublicKey

# Key Management Service API, REST: AsymmetricEncryptionCrypto.GetPublicKey

Gets value of public key.

## HTTP request

```
GET https://kms.api.cloud.yandex.net/kms/v1/asymmetricEncryptionKeys/{keyId}/publicKey
```

## Path parameters

#|
||Field | Description ||
|| keyId | **string**

Required field. ID of the asymmetric KMS key to be used for public key retrieval.

The maximum string length in characters is 50. ||
|#

## Response {#yandex.cloud.kms.v1.asymmetricencryption.AsymmetricGetPublicKeyResponse}

**HTTP Code: 200 - OK**

```json
{
  "keyId": "string",
  "publicKey": "string"
}
```

#|
||Field | Description ||
|| keyId | **string**

Required field. ID of the asymmetric KMS key to get public key of.

The maximum string length in characters is 50. ||
|| publicKey | **string**

Public key value.
The value is a PEM-encoded X.509 public key, also known as SubjectPublicKeyInfo (SPKI),
as defined in RFC 5280. ||
|#