EldoS | Feel safer!

Software components for data protection, secure storage and transfer

secure black box and mono touch

Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.
#17271
Posted: 08/12/2011 05:50:56
by Chuck Holdt (Standard support level)
Joined: 08/12/2011
Posts: 6

We use Secure Black box in a mono touch (iphone) app.

Non encrypted xml works well, but for encryption/decryption we have to set the licence key. On our web ASP.NET app this works flawlessly, but on the iphone (simulator), we get an error.

Is it generally possible to use the decryption on the iphone

Chuck
#17272
Posted: 08/12/2011 05:56:45
by Chuck Holdt (Standard support level)
Joined: 08/12/2011
Posts: 6

forgot to add the message

Unhandled Exception: System.TypeLoadException: Could not load type 'Microsoft.Win32.RegistryKey' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
at SBUtils.__Global.SetLicenseKey (System.String Key) [0x00000] in <filename unknown>:0
Unhandled Exception: System.TypeLoadException: Could not load type 'Microsoft.Win32.RegistryKey' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
at SBUtils.__Global.SetLicenseKey (System.String Key) [0x00000] in <filename unknown>:0
...
#17273
Posted: 08/12/2011 05:56:50
by Vsevolod Ievgiienko (EldoS Corp.)

Thank you for contacting us.

Could you please clarify what exact error do you get.
#17274
Posted: 08/12/2011 05:58:08
by Chuck Holdt (Standard support level)
Joined: 08/12/2011
Posts: 6

Sorry, forgot it but it is now there

chuck
#17275
Posted: 08/12/2011 06:37:20
by Ken Ivanov (EldoS Corp.)

Thank you for reporting the issue.

Frankly speaking, I doubt that you will be able to use standard (compiled with and intended to work with full .NET framework) SecureBlackbox assemblies with MonoTouch, as they are likely to use a different framework, containing different set of classes. We will investigate this issue deeper and then get back to you.
#17276
Posted: 08/12/2011 06:45:48
by Ken Ivanov (EldoS Corp.)

Below you will find the quotations from MonoTouch FAQ that confirm my doubts:

Quote

With which version of .NET is MonoTouch compatible?

MonoTouch is based on a hybrid .NET 2.0 and Silverlight 2 API profile. If you want to use existing C# code, you will need to compile it from scratch using our compiler and tools to make sure that the proper assemblies are referenced.


Quote

Can I use standard desktop Mono assemblies or .NET assemblies with MonoTouch?

You can not reuse the 1.0 or 2.0 desktop/server assemblies from Mono or .NET with MonoTouch.

To reuse existing .NET code with MonoTouch, you must recompile your libraries with MonoTouch's compiler and base assemblies.

In particular, replacing the assemblies from MonoTouch with assemblies from the desktop Mono edition will not work since many APIs are missing from the MonoTouch lightweight Mono profile.

APIs in .NET are bound to the core mscorlib library. On the desktop and server 1.0, 1.1 and 2.0 exists (version numbers: 1.0.3300.0, 1.0.5000.0 and 2.0.0.0 respectively), from the API exposed in mscorlib the rest of the assemblies flow.

In MonoTouch instead of using the server/desktop assemblies we picked the Silverlight foundation since this foundation is lighter: it has fewer dependencies, brings less code to the device and drop a number of features that do not apply to the iPhone (configuring the runtime through System.Configuration for example and .config files that end-users can edit).


According to the above, preparing a brand new SecureBlackbox assembly set explicitly for MonoTouch framework would be the only working solution. You MAY try to get use of Silverlight assembly set shipped with SecureBlackbox as well, though there is no guarantee. We will investigate the complexity of compiling an extra MonoTouch-targeted assembly set, and possibly consider extending the package with it.
#17277
Posted: 08/12/2011 08:17:59
by Chuck Holdt (Standard support level)
Joined: 08/12/2011
Posts: 6

Thank you for your fast answer, we will have a try on the suggested solution.

Chuck, MORE Projects
#17320
Posted: 08/17/2011 07:30:03
by Chuck Holdt (Standard support level)
Joined: 08/12/2011
Posts: 6

Hi, we tried the suggested way useing the silverlight dir.

We got three problems

1) when using decryption on the iphone simulator, we get the following error

Unhandled Exception: System.TypeLoadException: Could not load type 'SBUtils.TSBLicenseType' from assembly 'SecureBlackbox, Version=9.0.202.19112, Culture=neutral, PublicKeyToken=5a62fa96d0ac431a'.
at MoreProfile.XML.TMPXMLEncryptionHelper.Decrypt (System.String aKey, SBXMLCore.TElXMLDOMElement aNode) [0x0007c] in /Users/Tom.Flechsig/Documents/Entwicklung/MC24_Jedi/more profile v5/common/MPrBasicXMLV5.pas:140
at MoreProfile.XML.TXMLSavableList`1[MoreProfile.MyContract.TContractProperty].Decrypt () [0x0003e] in /Users/Tom.Flechsig/Documents/Entwicklung/MC24_Jedi/more profile v5/common/MprbasicXMLSavable.pas:1023
at MyContract24.UserDaten.datenEntschluesseln () [0x0009a] in /test/MyContract24App/MyContract24/UserDaten.cs:228
at MyContract24.UserDaten.datenLaden (Int32 _id) [0x00185] in /test/MyContract24App/MyContract24/UserDaten.cs:168
at MyContract24.UserDaten.anmelden (System.String _userName, System.String _pwd, System.String _vSafe) [0x00040] in /test/MyContract24App/MyContract24/UserDaten.cs:110
at MyContract24.LogInVC.anmelden () [0x00000] in /test/MyContract24App/MyContract24/LogInVC.xib.cs:118
at MyContract24.LogInVC.NewThreadMethod () [0x00010] in /test/MyContract24App/MyContract24/LogInVC.xib.cs:48
at System.Threading.Thread.StartUnsafe () [0x00016] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Threading/Thread.cs:684
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type 'SBUtils.TSBLicenseType' from assembly 'SecureBlackbox, Version=9.0.202.19112, Culture=neutral, PublicKeyToken=5a62fa96d0ac431a'.
at MoreProfile.XML.TMPXMLEncryptionHelper.Decrypt (System.String aKey, SBXMLCore.TElXMLDOMElement aNode) [0x0007c] in /Users/Tom.Flechsig/Documents/Entwicklung/MC24_Jedi/more profile v5/common/MPrBasicXMLV5.pas:140
at MoreProfile.XML.TXMLSavableList`1[MoreProfile.MyContract.TContractProperty].Decrypt () [0x0003e] in /Users/Tom.Flechsig/Documents/Entwicklung/MC24_Jedi/more profile v5/common/MprbasicXMLSavable.pas:1023
at MyContract24.UserDaten.datenEntschluesseln () [0x0009a] in /test/MyContract24App/MyContract24/UserDaten.cs:228
at MyContract24.UserDaten.datenLaden (Int32 _id) [0x00185] in /test/MyContract24App/MyContract24/UserDaten.cs:168
at MyContract24.UserDaten.anmelden (System.String _userName, System.String _pwd, System.String _vSafe) [0x00040] in /test/MyContract24App/MyContract24/UserDaten.cs:110
at MyContract24.LogInVC.anmelden () [0x00000] in /test/MyContract24App/MyContract24/LogInVC.xib.cs:118
at MyContract24.LogInVC.NewThreadMethod () [0x00010] in /test/MyContract24App/MyContract24/LogInVC.xib.cs:48
at System.Threading.Thread.StartUnsafe () [0x00016] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Threading/Thread.cs:684


normal XML handling works fine

2) When loading a big XML, the Programm just crashes

3) When trying to deploy to real iphone, a linking error occurs

Compiling to native code
/Developer/MonoTouch/usr/bin/mtouch -v --nomanifest --nosign -dev "/test/MyContract24App/MyContract24/bin/iPhone/Debug/MyContract24.app" "-r=/Developer/MonoTouch/usr/lib/mono/2.1/System.dll" "-r=/Users/Tom.Flechsig/Documents/Entwicklung/MC24_Jedi/RO-dlls/RemObjects.SDK.Monotouch.dll" "-r=/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll" "-r=/Users/Tom.Flechsig/Documents/Entwicklung/MC24_Jedi/RO-dlls/RemObjects.SDK.ZLib.Monotouch.dll" "-r=/Users/Tom.Flechsig/Documents/Entwicklung/MC24_Jedi/RO-dlls/RemObjects.InternetPack.Monotouch.dll" "-r=/Users/Tom.Flechsig/Documents/Entwicklung/MC24_Jedi/SBB-dlls/SecureBlackbox.XMLSecurity.dll" "-r=/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" "-r=/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll" "-r=/Developer/MonoTouch/usr/lib/mono/2.1/System.Data.dll" "-r=/Users/Tom.Flechsig/Documents/Entwicklung/SBB_iPhone/xmlbbox_net/Packages/SecureBlackbox.Charsets.dll" "-r=/Users/Tom.Flechsig/Documents/Entwicklung/SBB_iPhone/xmlbbox_net/Packages/SecureBlackbox.dll" "-r=/Users/Tom.Flechsig/Documents/Entwicklung/SBB_iPhone/xmlbbox_net/Packages/SecureBlackbox.PGP.dll" "-r=/Users/Tom.Flechsig/Documents/Entwicklung/SBB_iPhone/xmlbbox_net/Packages/SecureBlackbox.XML.dll" "-r=/Users/Tom.Flechsig/Documents/Entwicklung/MC24_Working/MPWebCommon_iPhone02/MPWebCommon_iPhone/bin/Debug/MPWebCommon_iPhone.dll" "-r=/Users/Tom.Flechsig/Documents/Entwicklung/MC24_Working/MyContractModelsLib_iPhone02/MyContractModelsLib_iPhone/bin/Debug/MyContractModelsLib_iPhone.dll" -debug -linksdkonly "-sdk=4.3" -v -v -v "/test/MyContract24App/MyContract24/bin/iPhone/Debug/MyContract24.exe"
Framework is: /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk
Copied /test/MyContract24App/MyContract24/bin/iPhone/Debug/MyContract24.exe to /test/MyContract24App/MyContract24/bin/iPhone/Debug/MyContract24.app/MyContract24.exe
Linking SDK only for assembly /test/MyContract24App/MyContract24/bin/iPhone/Debug/MyContract24.exe into /test/MyContract24App/MyContract24/bin/iPhone/Debug/MyContract24.app
Could not link assemblies: Mono.Linker.ResolutionException: Can not resolve reference: System.Boolean SBRDN.__Global::NonstrictCompareRDNAsStrings(SBRDN.TElRelativeDistinguishedName,SBRDN.TElRelativeDistinguishedName)
at Mono.Linker.Steps.MarkStep.ResolveMethodDefinition (Mono.Cecil.MethodReference method) [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.MarkStep.MarkMethod (Mono.Cecil.MethodReference reference) [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.MarkStep.MarkInstruction (Mono.Cecil.Cil.Instruction instruction) [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.MarkStep.MarkMethodBody (Mono.Cecil.Cil.MethodBody body) [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.MarkStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.MarkStep.ProcessQueue () [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.MarkStep.Process () [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.MarkStep.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0
at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0
at MonoTouch.Tuner.Linker.Run (Mono.Linker.Pipeline pipeline, Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0

perhaps you have some hints where to look
#17321
Posted: 08/17/2011 07:50:19
by Eugene Mayevski (EldoS Corp.)

Probably the only option for now is to look at wishlist and vote for MonoTouch version of SecureBlackbox. I.e. alien assemblies won't work for you.


Sincerely yours
Eugene Mayevski
#17322
Posted: 08/17/2011 07:55:02
by Chuck Holdt (Standard support level)
Joined: 08/12/2011
Posts: 6

Thanx,

i already did vote.

Chuck
Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.

Reply

Statistics

Topic viewed 2747 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!