def public_decrypt(self, value, padding=RSA_PKCS1_PADDING):
        if six.PY3 and not isinstance(value, bytes):
            buf = create_string_buffer(value.encode(), len(value))
        else:
            buf = create_string_buffer(value, len(value))
        size = RSA_size(self.key)
        output = create_string_buffer(size)
        ret = RSA_public_decrypt(len(buf), buf, output, self.key, padding)
        if ret <= 0:
            raise SSLError('Unable to decrypt data')
        if six.PY3 and isinstance(output.raw, bytes):
            return output.raw[:ret].decode()
        else:
            return output.raw[:ret]
dataset/ETHPy150Open coderanger/pychef/chef/rsa.py/Key.public_decrypt/original