For non-PQC algorithms, the default format is PEM, and the field
pem will be populated.
Otherwise, the public key will be exported through the
public_key field in the
requested format.
Generated from protobuf enum PUBLIC_KEY_FORMAT_UNSPECIFIED = 0;
PEM
Value: 1
The returned public key will be encoded in PEM format.
[[["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 PublicKeyFormat (2.3.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.3.1 (latest)](/php/docs/reference/cloud-kms/latest/V1.PublicKey.PublicKeyFormat)\n- [2.3.0](/php/docs/reference/cloud-kms/2.3.0/V1.PublicKey.PublicKeyFormat)\n- [2.2.0](/php/docs/reference/cloud-kms/2.2.0/V1.PublicKey.PublicKeyFormat)\n- [2.1.6](/php/docs/reference/cloud-kms/2.1.6/V1.PublicKey.PublicKeyFormat)\n- [2.0.0](/php/docs/reference/cloud-kms/2.0.0/V1.PublicKey.PublicKeyFormat)\n- [1.23.0](/php/docs/reference/cloud-kms/1.23.0/V1.PublicKey.PublicKeyFormat)\n- [1.22.1](/php/docs/reference/cloud-kms/1.22.1/V1.PublicKey.PublicKeyFormat)\n- [1.21.4](/php/docs/reference/cloud-kms/1.21.4/V1.PublicKey.PublicKeyFormat)\n- [1.20.3](/php/docs/reference/cloud-kms/1.20.3/V1.PublicKey.PublicKeyFormat)\n- [1.19.0](/php/docs/reference/cloud-kms/1.19.0/V1.PublicKey.PublicKeyFormat)\n- [1.18.1](/php/docs/reference/cloud-kms/1.18.1/V1.PublicKey.PublicKeyFormat)\n- [1.17.0](/php/docs/reference/cloud-kms/1.17.0/V1.PublicKey.PublicKeyFormat)\n- [1.16.4](/php/docs/reference/cloud-kms/1.16.4/V1.PublicKey.PublicKeyFormat)\n- [1.15.3](/php/docs/reference/cloud-kms/1.15.3/V1.PublicKey.PublicKeyFormat) \nReference documentation and code samples for the Cloud KMS V1 Client class PublicKeyFormat.\n\nThe supported [PublicKey](/php/docs/reference/cloud-kms/latest/V1.PublicKey) formats.\n\nProtobuf type `google.cloud.kms.v1.PublicKey.PublicKeyFormat`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Kms \\\\ V1 \\\\ PublicKey\n\nMethods\n-------\n\n### static::name\n\n### static::value\n\nConstants\n---------\n\n### PUBLIC_KEY_FORMAT_UNSPECIFIED\n\n Value: 0\n\nIf the\n[public_key_format](/php/docs/reference/cloud-kms/latest/V1.GetPublicKeyRequest#_Google_Cloud_Kms_V1_GetPublicKeyRequest__getPublicKeyFormat__)\nfield is not specified:\n\n- For PQC algorithms, an error will be returned.\n\n- For non-PQC algorithms, the default format is PEM, and the field\n [pem](/php/docs/reference/cloud-kms/latest/V1.PublicKey#_Google_Cloud_Kms_V1_PublicKey__getPem__) will be populated.\n Otherwise, the public 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\n requested format.\n\nGenerated from protobuf enum `PUBLIC_KEY_FORMAT_UNSPECIFIED = 0;`\n\n### PEM\n\n Value: 1\n\nThe returned public key will be encoded in PEM format.\n\nSee the [RFC7468](https://tools.ietf.org/html/rfc7468) sections for\n[General Considerations](https://tools.ietf.org/html/rfc7468#section-2)\nand [Textual Encoding of Subject Public Key Info](https://tools.ietf.org/html/rfc7468#section-13) for more information.\n\nGenerated from protobuf enum `PEM = 1;`\n\n### NIST_PQC\n\n Value: 3\n\nThis is supported only for PQC algorithms.\n\nThe key material is returned in the format defined by NIST PQC\nstandards (FIPS 203, FIPS 204, and FIPS 205).\n\nGenerated from protobuf enum `NIST_PQC = 3;`"]]