View previous topic :: View next topic |
Author |
Message |
Chris
Joined: 16 Nov 2007 Posts: 4
|
Posted: Tue Aug 24, 2010 4:56 pm Post subject: Using .NET Encryptor with Third Party DLLs |
|
|
Hello,
I am developing an application that uses a number of third party DLL files, and I would like to merge them into the bootstrap executable. I do not have access to the source for the dlls. And each of the libraries is signed with a strong name from the manufacturer.
Is it possible to use the .enc filles from these dlls merged into the bootstrap executable or do I have to obtain the source from each of the third parties and re-compile them with my own strong name?
Thanks,
Chris
BTW - Excellent job on the component! |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Tue Aug 24, 2010 10:51 pm Post subject: |
|
|
Provided that the third party DLLs are pure managed assemblies (ie not mixed assemblies) you can encrypt them and merge them into your bootstrap assembly. Since they aren't signed with your strong name you will need to explicitly specify the strong name to use to encrypt them. You can do this using the /strongnamefile option when encrypting the assembly. See the Command Line Options section in the help for more details. _________________ Infralution Support |
|
Back to top |
|
|
CynoxDev
Joined: 15 Feb 2013 Posts: 8
|
Posted: Fri Feb 15, 2013 1:44 pm Post subject: |
|
|
I have a class library project signed with its own pfx key-file that is referenced by the main application. The bootstrap project uses the same key file that is used by the main assembly. I specified the key file and the corresponding password for the class library using in the pre-build command line.
When i start the bootstrap executable, i get an exception "An unhandled exception occurred while bootstrapping the application." that further states that at least one type cannot be accessed. When i copy the class library to the folder, the application starts without problems, so the bootstrap doesn't seem to be able to extract the dll.
When i use the key file of the application for the class library, everything works fine. Is there something i am missing?
Tank you in advance,
Marcus |
|
Back to top |
|
|
CynoxDev
Joined: 15 Feb 2013 Posts: 8
|
Posted: Fri Feb 15, 2013 2:05 pm Post subject: |
|
|
I already solved it.
I was under the misconception that i need to specify the key-file and password that the class library was signed with (i thought the Encryptor somehow required this information to process the file). However, the key file from the main assembly is required so that the Encryptor can encrypt the file with the same key.
(correct me if i am still wrong ) |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Sat Feb 16, 2013 2:41 am Post subject: |
|
|
That's correct. If an assembly is signed with the same strong name as the bootstrap assembly then you don't need to use the /token or /strongnamefile options because .NET Encryptor can just use the assemblies own strong name (which matches bootstrap). If an assembly is signed with a different strong name then you have to to provide the bootstrap assemblies public token or strongname. _________________ Infralution Support |
|
Back to top |
|
|
|