class_docstr: Implementation for experiment payload builder
  using public key RSA encryption.
class_docstr_tok: ["Implementation","for","experiment","payload","builder","using","public","key","RSA","encryption","."]
code: def _decrypt_data(
      self, private_key_path, encrypted_key_text, encrypted_data_text
  ):
      private_key = self._import_rsa_key(private_key_path)
      if private_key is None:
          return None
  
      try:
          private_key = RSA.import_key(open(private_key_path).read())
      except:
          self.logger.error(
              "FAILED to import private key from: {0}".format(
                  private_key_path
              )
          )
          return None
  
      # Decrypt the session key with the private RSA key
      cipher_rsa = PKCS1_OAEP.new(private_key)
      session_key = cipher_rsa.decrypt(
          base64.b64decode(encrypted_key_text)
      )
  
      # Decrypt the data with the NaCL session key
      box_in = nacl.secret.SecretBox(session_key)
      decrypted_data = box_in.decrypt(
          base64.b64decode(encrypted_data_text)
      )
      decrypted_data = decrypted_data.decode("utf-8")
  
      return decrypted_data
  
file_path: studio/studio/completion_service/encryptor.py
imports: import sys
  from Crypto.PublicKey import RSA
  from Crypto.Cipher import PKCS1_OAEP
  import nacl.secret
  import nacl.utils
  import base64
label_desc: Use image node_id 4 for calling the Encryptor obj's underlying member method code with example usage: obj._decrypt_data(private_key_path, encrypted_key_text, encrypted_data_text) and returns: decrypted_data, None, None