[quoted text, click to view] "Eugene" <Eugene@discussions.microsoft.com> wrote in message
news:1036870E-A959-47A1-B17D-BA2F1939D150@microsoft.com...
> Hi, can I configure/program my vb.net exe/dll to trust on only a
> particular
> Certification Authority (CA)?
Yes, but you can't make the CLR trust only your CA.
[quoted text, click to view] > For example, I would create a new CA, it would
> certainly those dlls that I created. Then, my exe would trust only this
> CA,
> thus only those dlls that I created.
What you actually want is for the CLR to access only your CA for certificate
verification when your assemblies are loaded, and this is not possible
without modifying the CLR itself.
[quoted text, click to view] > What I want to do is to prevent someone else of creating new dlls without
> my
> knowledge, and runs it with my program.
You can't. If they have physical control over the deployment, they can
modify your DLLs as well as swapping in entirely new DLLs. There is nothing
you can do to completely prevent this, although obfuscation can be used to
make this sort of thing more difficult.
[quoted text, click to view] > If my program can trust the trusted
> CA configured at IE, then they can just create their own CA and trust
> their
> own dll, and cause my program to trust them too, right?
>
> I don't think I can just simply use strong name as my program loads these
> dlls using reflection, rather than direct referencing them.
Strong name verifications will only protect against spoofing attempts by
partially trusted code. They are useful, but not against the type of
in-situ assembly swapping that you envisage.
BTW, if you know the identity of your assemblies, why are you loading them
via reflection? Is this a plug-in scenario and, if so, are you attempting
to limit plugins that can be loaded to only those signed with a certificate
from your CA?
[quoted text, click to view] > Or, is there any other way that I can achieve my objective?
> I have look at other security topics including code access security, but I
> don't understand them, and I don't know which one can actually help me
> solve
> my issue.
Obfuscation is probably worth considering. Also, if you're loading plug-in
assemblies, then you can control criteria for the issuing CA for an
assembly's signature, but this won't be particularly useful unless you make
it difficult to modify the code that verifies the CA identity.