All Products
Search
Document Center

Key Management Service:GetPublicKey

Last Updated:Mar 31, 2026

Queries the public key of an asymmetric key.

Request parameters

ParameterTypeRequiredExampleDescription
KeyIdstringYes1234abcd-12ab-34cd-56ef-12345678****The globally unique ID of the key. To use an alias, specify an alias bound to the key.

Response elements

ParameterTypeExampleDescription
KeyIdstring1234abcd-12ab-34cd-56ef-12345678****The globally unique ID of the key. If the request uses a key alias, the ID of the key bound to that alias is returned.
PublicKeystring-----BEGIN PUBLIC KEY----- MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEy1ywbEU17uqak8PNqv54BDdtE7+n CGXuj8nKmhPNl3AmN8z2roAowQYORs4JTTfmmLq0jvIU0hBCsSS3aY****== -----END PUBLIC KEY-----The public key in PEM format.
RequestIdstring475f1620-b9d3-4d35-b5c6-3fbdd941423dThe request ID.

Error codes

For a list of error codes, see Common error codes.