:doc:`CloudFront <../../cloudfront>` / Client / update_public_key

*****************
update_public_key
*****************



.. py:method:: CloudFront.Client.update_public_key(**kwargs)

  

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

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2020-05-31/UpdatePublicKey>`_  


  **Request Syntax**
  ::

    response = client.update_public_key(
        PublicKeyConfig={
            'CallerReference': 'string',
            'Name': 'string',
            'EncodedKey': 'string',
            'Comment': 'string'
        },
        Id='string',
        IfMatch='string'
    )
    
  :type PublicKeyConfig: dict
  :param PublicKeyConfig: **[REQUIRED]** 

    A public key configuration.

    

  
    - **CallerReference** *(string) --* **[REQUIRED]** 

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

      

    
    - **Name** *(string) --* **[REQUIRED]** 

      A name to help identify the public key.

      

    
    - **EncodedKey** *(string) --* **[REQUIRED]** 

      The public key that you can use with `signed URLs and signed cookies <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html>`__, or with `field-level encryption <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/field-level-encryption.html>`__.

      

    
    - **Comment** *(string) --* 

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

      

    
  
  :type Id: string
  :param Id: **[REQUIRED]** 

    The identifier of the public key that you are updating.

    

  
  :type IfMatch: string
  :param IfMatch: 

    The value of the ``ETag`` header that you received when retrieving the public key to update. For example: ``E2QWRUHAPOMQZL``.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'PublicKey': {
              'Id': 'string',
              'CreatedTime': datetime(2015, 1, 1),
              'PublicKeyConfig': {
                  'CallerReference': 'string',
                  'Name': 'string',
                  'EncodedKey': 'string',
                  'Comment': 'string'
              }
          },
          'ETag': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **PublicKey** *(dict) --* 

        The public key.

        
        

        - **Id** *(string) --* 

          The identifier of the public key.

          
        

        - **CreatedTime** *(datetime) --* 

          The date and time when the public key was uploaded.

          
        

        - **PublicKeyConfig** *(dict) --* 

          Configuration information about a public key that you can use with `signed URLs and signed cookies <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html>`__, or with `field-level encryption <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/field-level-encryption.html>`__.

          
          

          - **CallerReference** *(string) --* 

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

            
          

          - **Name** *(string) --* 

            A name to help identify the public key.

            
          

          - **EncodedKey** *(string) --* 

            The public key that you can use with `signed URLs and signed cookies <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html>`__, or with `field-level encryption <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/field-level-encryption.html>`__.

            
          

          - **Comment** *(string) --* 

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

            
      
    
      

      - **ETag** *(string) --* 

        The identifier of the current version of the public key.

        
  
  **Exceptions**
  
  *   :py:class:`CloudFront.Client.exceptions.PreconditionFailed`

  
  *   :py:class:`CloudFront.Client.exceptions.AccessDenied`

  
  *   :py:class:`CloudFront.Client.exceptions.NoSuchPublicKey`

  
  *   :py:class:`CloudFront.Client.exceptions.CannotChangeImmutablePublicKeyFields`

  
  *   :py:class:`CloudFront.Client.exceptions.IllegalUpdate`

  
  *   :py:class:`CloudFront.Client.exceptions.InvalidArgument`

  
  *   :py:class:`CloudFront.Client.exceptions.InvalidIfMatchVersion`

  