I have an interface which implementing classes export via MEF in my application. The implementing classes are in separate assemblies and aren't known about at compile-time (think plug-ins).

The interface basically consists of a call which says 'here is a bunch of key-value pairs, now initialise your licensing state'. I.e.

`public LicensingInfo InitialiseLicense(IEnumerable<KeyValuePair<string, string>> keys)`

What I would like to know is - is there any way of protecting that interface from a 'middle man' implementation? I.e. one that receives the call from my application, then calls the same method on the plug-in assembly with a different bunch of key-value pairs, basically saying 'yes - here you go - have everything'.

I did try and think of it a different way, in that the application would call the plug-in assembly and pass in an object which could be queried. That method might look something like this:

`public LicensingInfo InitialiseLicense(ILicenseQueryProvider provider)`

However, again with this method I think that an intercepting object could just simply give a different provider to the library. 

So, is there a way I could prevent such interface interception, or should I refactor it such that the plug-in assembly is entirely responsible for licence loading etc within it's own code? Or is there another way, perhaps, that I could refactor it that I haven't considered?