Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-3309

Explicit Queryable Encryption doc example needs to utilize index_key_Id

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 4.2
    • Affects Version/s: None
    • Component/s: Docs, Encryption
    • None

      When encrypting a value to store in a document, both key_id and index_key_Id are required. The explicit Queryable Encryption doc example only uses key_id, it needs to utilize index_key_Id too:

          # Create and encrypt an indexed and unindexed value.
          val = "encrypted indexed value"
          unindexed_val = "encrypted unindexed value"
          insert_payload_indexed = client_encryption.encrypt(val, Algorithm.INDEXED, indexed_key_id)
          insert_payload_unindexed = client_encryption.encrypt(unindexed_val, Algorithm.UNINDEXED,
          unindexed_key_id)
      

      For a correct example see the test Kevin is adding here: https://github.com/mongodb/specifications/pull/1249/files#diff-c57f446f49351e6f7432a2d3028c880a728f1a33031510a7c376aed157d6de00R1786

            Assignee:
            julius.park@mongodb.com Julius Park (Inactive)
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: