def _decrypt_data_key(
        self, encrypted_data_key: EncryptedDataKey, algorithm: AlgorithmSuite, encryption_context: Dict[Text, Text]
    ) -> DataKey:
        """Decrypt an encrypted data key and return the plaintext.

        :param data_key: Encrypted data key
        :type data_key: aws_encryption_sdk.structures.EncryptedDataKey
        :param algorithm: Algorithm object which directs how this Master Key will encrypt the data key
        :type algorithm: aws_encryption_sdk.identifiers.Algorithm
        :param dict encryption_context: Encryption context to use in decryption
        :returns: Data key containing decrypted data key
        :rtype: aws_encryption_sdk.structures.DataKey
        :raises DecryptKeyError: if Master Key is unable to decrypt data key
        """
        if encrypted_data_key.encrypted_data_key != self._encrypted_data_key:
            raise DecryptKeyError(
                'Master Key "{provider}" unable to decrypt data key'.format(provider=self.key_provider)
            )

        return self._generate_data_key(algorithm, encryption_context)