UpdatePublicKey - Amazon CloudFront
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).


Update public key information. Note that the only value you can change is the comment.

Request Syntax

PUT /2020-05-31/public-key/Id/config HTTP/1.1 <?xml version="1.0" encoding="UTF-8"?> <PublicKeyConfig xmlns="http://cloudfront.amazonaws.com/doc/2020-05-31/"> <CallerReference>string</CallerReference> <Comment>string</Comment> <EncodedKey>string</EncodedKey> <Name>string</Name> </PublicKeyConfig>

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in XML format.


Root level tag for the PublicKeyConfig parameters.

Required: Yes


A string included in the request to help make sure that the request can't be replayed.

Type: String

Required: Yes


A comment to describe the public key. The comment cannot be longer than 128 characters.

Type: String

Required: No


The public key that you can use with signed URLs and signed cookies, or with field-level encryption.

Type: String

Required: Yes


A name to help identify the public key.

Type: String

Required: Yes

Response Syntax

HTTP/1.1 200 <?xml version="1.0" encoding="UTF-8"?> <PublicKey> <CreatedTime>timestamp</CreatedTime> <Id>string</Id> <PublicKeyConfig> <CallerReference>string</CallerReference> <Comment>string</Comment> <EncodedKey>string</EncodedKey> <Name>string</Name> </PublicKeyConfig> </PublicKey>

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in XML format by the service.


Root level tag for the PublicKey parameters.

Required: Yes


The date and time when the public key was uploaded.

Type: Timestamp


The identifier of the public key.

Type: String


Configuration information about a public key that you can use with signed URLs and signed cookies, or with field-level encryption.

Type: PublicKeyConfig object


For information about the errors that are common to all actions, see Common Errors.


Access denied.

HTTP Status Code: 403


You can't change the value of a public key.

HTTP Status Code: 400


The update contains modifications that are not allowed.

HTTP Status Code: 400


An argument is invalid.

HTTP Status Code: 400


The If-Match version is missing or not valid.

HTTP Status Code: 400


The specified public key doesn't exist.

HTTP Status Code: 404


The precondition in one or more of the request fields evaluated to false.

HTTP Status Code: 412

See Also

For more information about using this API in one of the language-specific Amazon SDKs, see the following: