Optional. ThePublicKeyformat specified by the user. This field is required for PQC algorithms. If specified, the public key will be exported through thepublic_keyfield in the requested format. Otherwise, thepemfield will be populated for non-PQC algorithms, and an error will be returned for PQC algorithms.
Optional. ThePublicKeyformat specified
by the user. This field is required for PQC algorithms. If specified, the
public key will be exported through thepublic_keyfield in the
requested format. Otherwise, thepemfield will be populated for non-PQC algorithms, and an error will be
returned for PQC algorithms.
Returns
Type
Description
int
setPublicKeyFormat
Optional. ThePublicKeyformat specified
by the user. This field is required for PQC algorithms. If specified, the
public key will be exported through thepublic_keyfield in the
requested format. Otherwise, thepemfield will be populated for non-PQC algorithms, and an error will be
returned for PQC algorithms.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
static::build
Parameter
Name
Description
name
string
Required. Thenameof theCryptoKeyVersionpublic key to get. Please seeKeyManagementServiceClient::cryptoKeyVersionName()for help formatting this field.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Cloud KMS V1 Client - Class GetPublicKeyRequest (2.3.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.3.1 (latest)](/php/docs/reference/cloud-kms/latest/V1.GetPublicKeyRequest)\n- [2.3.0](/php/docs/reference/cloud-kms/2.3.0/V1.GetPublicKeyRequest)\n- [2.2.0](/php/docs/reference/cloud-kms/2.2.0/V1.GetPublicKeyRequest)\n- [2.1.6](/php/docs/reference/cloud-kms/2.1.6/V1.GetPublicKeyRequest)\n- [2.0.0](/php/docs/reference/cloud-kms/2.0.0/V1.GetPublicKeyRequest)\n- [1.23.0](/php/docs/reference/cloud-kms/1.23.0/V1.GetPublicKeyRequest)\n- [1.22.1](/php/docs/reference/cloud-kms/1.22.1/V1.GetPublicKeyRequest)\n- [1.21.4](/php/docs/reference/cloud-kms/1.21.4/V1.GetPublicKeyRequest)\n- [1.20.3](/php/docs/reference/cloud-kms/1.20.3/V1.GetPublicKeyRequest)\n- [1.19.0](/php/docs/reference/cloud-kms/1.19.0/V1.GetPublicKeyRequest)\n- [1.18.1](/php/docs/reference/cloud-kms/1.18.1/V1.GetPublicKeyRequest)\n- [1.17.0](/php/docs/reference/cloud-kms/1.17.0/V1.GetPublicKeyRequest)\n- [1.16.4](/php/docs/reference/cloud-kms/1.16.4/V1.GetPublicKeyRequest)\n- [1.15.3](/php/docs/reference/cloud-kms/1.15.3/V1.GetPublicKeyRequest) \nReference documentation and code samples for the Cloud KMS V1 Client class GetPublicKeyRequest.\n\nRequest message for\n[KeyManagementService.GetPublicKey](/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__getPublicKey__).\n\nGenerated from protobuf message `google.cloud.kms.v1.GetPublicKeyRequest`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Kms \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nRequired. The [name](/php/docs/reference/cloud-kms/latest/V1.CryptoKeyVersion#_Google_Cloud_Kms_V1_CryptoKeyVersion__getName__) of the\n[CryptoKeyVersion](/php/docs/reference/cloud-kms/latest/V1.CryptoKeyVersion) public key to get.\n\n### setName\n\nRequired. The [name](/php/docs/reference/cloud-kms/latest/V1.CryptoKeyVersion#_Google_Cloud_Kms_V1_CryptoKeyVersion__getName__) of the\n[CryptoKeyVersion](/php/docs/reference/cloud-kms/latest/V1.CryptoKeyVersion) public key to get.\n\n### getPublicKeyFormat\n\nOptional. The [PublicKey](/php/docs/reference/cloud-kms/latest/V1.PublicKey) format specified\nby the user. This field is required for PQC algorithms. If specified, the\npublic key will be exported through the\n[public_key](/php/docs/reference/cloud-kms/latest/V1.PublicKey#_Google_Cloud_Kms_V1_PublicKey__getPublicKey__) field in the\nrequested format. Otherwise, the [pem](/php/docs/reference/cloud-kms/latest/V1.PublicKey#_Google_Cloud_Kms_V1_PublicKey__getPem__)\nfield will be populated for non-PQC algorithms, and an error will be\nreturned for PQC algorithms.\n\n### setPublicKeyFormat\n\nOptional. The [PublicKey](/php/docs/reference/cloud-kms/latest/V1.PublicKey) format specified\nby the user. This field is required for PQC algorithms. If specified, the\npublic key will be exported through the\n[public_key](/php/docs/reference/cloud-kms/latest/V1.PublicKey#_Google_Cloud_Kms_V1_PublicKey__getPublicKey__) field in the\nrequested format. Otherwise, the [pem](/php/docs/reference/cloud-kms/latest/V1.PublicKey#_Google_Cloud_Kms_V1_PublicKey__getPem__)\nfield will be populated for non-PQC algorithms, and an error will be\nreturned for PQC algorithms.\n\n### static::build"]]