EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Windows Phone sample?

Posted: 10/25/2011 10:16:23
by Ben Williams (Basic support level)
Joined: 08/16/2011
Posts: 6

Is there a sample? The only samples I see are windows forms. I tried copying the method from those for TElSimpleSSLClient but the call to SBUtils.Unit.SetLicenseKey throws an TypeInitializationException.
Posted: 10/25/2011 10:21:57
by Vsevolod Ievgiienko (Team)

We don't have Windows Phone samples for TElSimpleSSLClient yet. Have you added an appropriate references to assemblies? These assemblies are located in \EldoS\SecureBlackbox.NET\Assemblies\WP75 folder.
Posted: 10/25/2011 13:18:13
by Ben Williams (Basic support level)
Joined: 08/16/2011
Posts: 6

Yes I have them added. At first I just had SecureBlackBox, SSLClient, And SSLCommon but then I added all of them just to make sure.

If I create a TElSecureClient I get an error that I need to set the license key, so I copied the call from the samples (Its the same in both samples)


thanks for the help - ben

but that call throws the following exception

System.TypeInitializationException was unhandled
  Message=The type initializer for 'SBRevokedKeys' threw an exception.
       at SBUtils.__Global.SetLicenseKey(Byte[] Key)
       at SBUtils.__Global.SetLicenseKey(String Key)
       at SBBPhoneTest.MainPage.Init()
       at SBBPhoneTest.MainPage.button1_Click(Object sender, RoutedEventArgs e)
       at System.Windows.Controls.Primitives.ButtonBase.OnClick()
       at System.Windows.Controls.Button.OnClick()
       at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
       at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
       at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)

I stripped everything out except the one call to SetLicenseKey and it does the same thing. I also tried replacing the string with an empty string and it behaves the same on the emulator and on the device.
Posted: 10/25/2011 13:43:38
by Ken Ivanov (Team)

Still we suggest you to re-check once again that the correct assembly set is referenced from your project (do NOT add references to the assemblies installed in the GAC - instead, select the assemblies from the appropriate set installed on the local hard drive). I have just created a brand new project referencing SecureBlackbox.dll from the WP75 folder, and SetLicenseKey() call proves to work as expected with it.
Posted: 11/11/2011 00:59:17
by Ben Williams (Basic support level)
Joined: 08/16/2011
Posts: 6

They are all referenced from the C:\Program Files (x86)\EldoS\SecureBlackbox.NET\Assemblies\WP75 folder and being copied locally. I uninstalled everything and reinstalled from the latest release just to be sure. I only installed the wp7.5 assemblies. There are no secureblackbox assemblies in the GAC.

any other ideas?
Posted: 11/11/2011 01:54:15
by Vsevolod Ievgiienko (Team)

We have reproduced the problem and will write you back as soon as the solution will be ready.
Posted: 11/11/2011 03:53:50
by Eugene Mayevski (Team)

Fixed. The updated build is on the site. Since there were no changes in it besides WP assemblies, we didn't increase build number and only the date has been changed.

Sincerely yours
Eugene Mayevski
Posted: 11/11/2011 08:03:05
by Matthijs Hoekstra (Basic support level)
Joined: 11/10/2011
Posts: 7

I would really like a working sample for Windows Phone. This simple code just returns errors:

            TElHTTPSClient client = new TElHTTPSClient();

            catch (Exception ex)


The exception is for http and https:

{"Method not found: HTTPCommandStrings SBHTTPSConstants.__Global."}
[System.TypeInitializationException]: {"Method not found: HTTPCommandStrings SBHTTPSConstants.__Global."}
_data: null
_HResult: -2146233036
_innerException: null
_message: "Method not found: HTTPCommandStrings SBHTTPSConstants.__Global."
_methodDescs: {System.IntPtr[9]}
_optionalData: {string[1]}
Data: {System.Collections.ListDictionaryInternal}
HResult: -2146233036
InnerException: Could not evaluate expression
Message: "Method not found: HTTPCommandStrings SBHTTPSConstants.__Global."
StackTrace: " at SBHTTPSClient.TElHTTPSClient.InitiateRequest(Int32 Method, String URL)\r\n at SBHTTPSClient.TElHTTPSClient.PerformRequest(Int32 Method, String URL)\r\n at SBHTTPSClient.TElHTTPSClient.Get(String URL)\r\n at PhoneApp5.MainPage.button1_Click(Object sender, RoutedEventArgs e)\r\n at System.Windows.Controls.Primitives.ButtonBase.OnClick()\r\n at System.Windows.Controls.Button.OnClick()\r\n at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)\r\n at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)\r\n at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)\r\n"

Any ideas, I really want to get this to work on a Windows Phone Mango project.
Posted: 11/11/2011 08:30:11
by Eugene Mayevski (Team)

Will be fixed in a couple of hours.

About samples: we have SFTP and FTPS client samples for WindowsPhone in C#. Please see \Samples\C#\SFTPBlackbox\Client\WindowsPhone and \Samples\C#\FTPSBlackbox\Client\WindowsPhone folders accordingly.

A side note: remember to use CODE button to mark your code blocks in your posts.

Sincerely yours
Eugene Mayevski
Posted: 11/11/2011 11:33:21
by Eugene Mayevski (Team)

I've uploaded the installation again. It contains verified samples for Windows Phone 7.5.

Problems in this topic are caused by the design flaw of .NET runtime on the phone. The runtime doesn't support certain kind of arrays which are valid on all platforms and in all languages. Now, you can't find out such array until you come across it during execution. Accidentally it's also trivial to break existing code, cause use of those arrays is disabled by compiler define which got overriden in two places during code merge. Since the define (or lack of it) doesn't make the code invalid, we could not see that the code got broken.

Sincerely yours
Eugene Mayevski



Topic viewed 31939 times

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


Back to top

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

Got it!